-
Notifications
You must be signed in to change notification settings - Fork 8
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: module dir paths and lsp error unwrapping #1705
Conversation
} | ||
|
||
return []string{"."} |
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.
Since "."
is not an absolute path, do you want to update that to be absolute in this function as well?
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.
Yeah good question! Maybe we should just add this absolute path when parsing/merge if there's nothing in the toml
file. Then this would just return the absModuleDirs
instead of "."
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.
That makes sense to me :)
@@ -78,9 +78,12 @@ func (s *Server) post(err error) { | |||
errUnspecified := []error{} | |||
|
|||
// Deduplicate and associate by filename. | |||
for _, err := range ftlErrors.DeduplicateErrors(ftlErrors.UnwrapAll(err)) { | |||
for _, e := range ftlErrors.DeduplicateErrors(ftlErrors.UnwrapAll(err)) { | |||
if !ftlErrors.Innermost(e) { |
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.
niiiiice :D
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.
All @worstell here 😂
859a64e
to
b5b946d
Compare
@@ -32,16 +32,12 @@ type Config struct { | |||
ExternalDirs []string `toml:"external-dirs"` | |||
Commands Commands `toml:"commands"` | |||
FTLMinVersion string `toml:"ftl-min-version"` | |||
absModuleDirs []string |
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.
This feels a bit gross, but I don't have any better ideas.
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.
I had exactly the same feeling. I'm also not 100% sure how we want the abs paths to be computed given that it's possible reference multiple ftl-project.toml
files, but those files could be at different paths. Which, is what led me to this approach so that at least the modules
will be relative to the ftl-project.toml
file.
Definitely feels like this will need more thought in the future though.
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.
Yeah, and also the working directory of the process could change after construction, so we can't rely on dynamically making them absolute. It seems like the best solution.
Unrelated but why is that error duplicated three times? Can we fix that? |
This fixes clearing of errors from the lsp when modules are being rebuilt and improves duplication of errors (thanks @worstell!!)