This repository has been archived by the owner on Jan 31, 2025. It is now read-only.
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.
The
gno transpile -gobuild
command did not work because there was no go.mod file in the directory. Adding theGO111MODULE=off
env discards this error and makes the command work properly.Other changes:
GnoFile
argument fromTranspile
because the command should be run on the workspace folder instead of just the directory of where theGnoFile
is located. Adding a new fieldworkspaceFolder
in theserver
struct for that purpose, this field is set at theinitialize
LSP step.Transpile()
andTranspileAndBuild()
functions, because the errors format between transpile and gobuild is the same since fix: unify the precompile output to make it easier to parse and read. gno#1670.ParseErrors
so it stops trying the guess the column end of the error (remove call tofindErrors
). I consider this step unecessary because it is not reliable. This also makes the function faster because it stops iterating over the file's tokens.gno
binary is reported.getTranspileDiagnostics()
so it filters the errors according to the file in parameter. Also removes looking at the errors in the typecheck cache, because all the errors are returned bygno transpile -gobuild
. I'm not sure about the future of typecheck cache with this change, maybe it should be completely removed.As a result of these changes, the test
document_open.txtar
is updated:code
is nowtranspile
instead oftypecheck
(because the errors come now from the transpile command instead of the typecheck cache)findErrors
is no longer invoked)I know these changes are a bit opinionated, I am of course open to discussion.