Repository navigation
Remove the /search type-search endpoint - #326
Open
thomashoneyman wants to merge 1 commit into
Open
thomashoneyman wants to merge 1 commit into
thomashoneyman wants to merge 1 commit into
Conversation
No client has ever called /search, and it is undocumented. It has answered every query with "Cannot parse type" since the 0.13 update: it lexed queries with lexTopLevel, whose layout tokens parseTypeP rejects. Queries with type variables would also crash the search on current compilers, which need kinds on its skolems and unknowns. Remove the route and its helpers, along with the compiler Environment that only the search used.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
Removes the compile server's
/searchtype-search endpoint, along with its helpers (tryParseType,lookupAllConstructors,replaceTypeVariablesAndDesugar) and the compilerEnvironmentthat only the search used.The endpoint was added in 2017 as a first stab at type search. Nothing calls it: not the client, nor Pursuit, which has its own type search. It is not documented in the README's Server API section either. It has also been broken since the update to PureScript 0.13 in c9da168: every query, including
Intanda -> a, returns{"error":"Cannot parse type"}on production.tryParseTypelexes queries withCST.lexTopLevel, which wraps the tokens inTokLayoutStart/TokLayoutEnd, soparseTypePrejects every query with "Unexpected or mismatched indentation". Pursuit and the compiler's REPL consume those layout tokens; this code did not.internalError "Skolem has no kind": since 0.14, unification checks kinds, and the search built kindless skolems and unregistered unknowns.Fixing both works (I verified a fix locally), but since nothing uses the endpoint, removing it is less code to carry through future compiler upgrades.
Verified locally with PureScript 0.15.17: the server builds with
-Wall -Werror;GET /search?q=Intnow returns 404;POST /compilestill returns JS for a valid program and anUnknownNameerror for an invalid one.Checklist: