-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problems reporting errors between multiple files #1224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just left a few comments.
quint/src/repl.ts
Outdated
@@ -625,10 +629,21 @@ function printErrorMessages( | |||
const modulesText = state.moduleHist + inputText | |||
const messages = errors.map(mkErrorMessage(state.compilationState.sourceMap)) | |||
// display the error messages and highlight the error places | |||
// FIXME: moudulesText can come from multiple files, but `compileFromCode` ignores that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe open an issue on that?
quint/src/runtime/compile.ts
Outdated
@@ -276,7 +279,9 @@ export function compileFromCode( | |||
rand: (bound: bigint) => bigint | |||
): CompilationContext { | |||
// parse the module text | |||
const { modules, table, sourceMap, errors } = parse(idGen, '<module_input>', mainPath, code) | |||
// FIXME: We should build a proper sourceCode map from the files we previously loaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also open an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both should be fixed with #1052, but I'll make sure to add this additional requirement there!
Hello
This fixes #1199 and fixes #1174 both on CLI and language server.
Instead of keeping the source code as a string, we have to keep it as a map from filenames to file content. We then use this map to properly report errors.
CHANGELOG.md
for any new functionalityREADME.md
updated for any listed functionality