Skip to content
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

make dirty files unique as nimsuggest expects (fixes #180) #182

Closed
wants to merge 2 commits into from
Closed

make dirty files unique as nimsuggest expects (fixes #180) #182

wants to merge 2 commits into from

Conversation

JorySchossau
Copy link

@JorySchossau JorySchossau commented Nov 4, 2020

Fixes #180

Description:
includes appeared to not be processed correctly. This is because nimsuggest (and the nim compiler) assumes that all dirty files are unique. However, nimsuggest was using 1 shared dirty file. This fix creates a directory structure in the same tmp dir mirroring the project structure. EDIT: I could've used hashes for everything to make them unique, but decided to keep human-readable naming as much as possible so only used a hash postfix for the root dir, in case anything needs introspection later on or for debugging.

Old tmp Structure:
/tmp/vscodenimdirty.nim

New tmp Structure:
/tmp/<project_dir_name>-<unique_number>/path/to/file/in/project

Old Behavior:
MWE in #180 shows autocompletion stops working when switching files

New Behavior:
autocompletion now works despite switching files

Possible issues:
Should append a unique ID for the <project_dir_name>, otherwise multiple projects might end up clobbering each other.
For example, 2 projects with 1 clobbering file.
ProjectA/main.nim
ProjectA/moduleXYZ.nim
another/ProjectA/main.nim
another/ProjectA/moduleABC.nim
This would clobber in tmp as follows: /tmp/ProjectA/main.nim
I avoided the complete system path because some systems get cranky with long paths. Thoughts?

Fixed; see commit.

@JorySchossau JorySchossau changed the title changed shared dirty file to unique files;req mkdirp makes dirty files unique as nimsuggest expects (fixes #180) Nov 4, 2020
@JorySchossau JorySchossau changed the title makes dirty files unique as nimsuggest expects (fixes #180) make dirty files unique as nimsuggest expects (fixes #180) Nov 4, 2020
@JorySchossau JorySchossau closed this by deleting the head repository May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not process includes as well as nimsuggest CLI (MWE)
1 participant