-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Rewrite scanner service #91
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.
One thing I just realized was that my original fix for #31 depends on the fact that your scanner would reach into node_modules if an import is explicitly specified.
Do you want to add that functionality back? Otherwise one integration test would be broken.
I think this shouldn't cause much performance issue. For SCSS files in node_modules, scan once and mark the cache frozen. For future scans you can just use the cached results from first time parsing.
@@ -53,11 +53,6 @@ | |||
"default": true, | |||
"description": "Allows scan imported files." | |||
}, | |||
"scss.scanImportedFilesDepth": { |
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 like removal of this option. It doesn't make much sense to me.
You probably want to update README as well.
Of course, I will return this functionality. |
return doScanner(workspaceRoot, cache, settings).then(symbols => { | ||
return invalidateCacheStorage(cache, symbols); | ||
}); | ||
return scannerService.scan(files); |
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.
We must disable recursive scanning here, because we only check changed files.
af3fb53
to
94be979
Compare
94be979
to
369c1b6
Compare
369c1b6
to
2326886
Compare
@octref, please, take a look at this pull request. |
src/server.ts
Outdated
const symbols = await doScanner(workspaceRoot, cache, settings); | ||
|
||
invalidateCacheStorage(cache, symbols); | ||
return scannerService.scan(files, /* recursive */ false); |
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.
Most likely here we need to always use recursive
mode, because a new import may appear in the document. However, this may slow down intellisense.
Right now the cache term is not valid, because we use cache as storage.
I had a rough look. The change looks good! |
Thanks, Pine! Yeap, I want to publish the new version on this weekend. With bug fix for #92 (comment) |
3788844
to
ca11679
Compare
const isImplicitlyImport = isImplicitly(symbols.document, documentPath, documentImports); | ||
const fsPath = getDocumentPath(documentPath, isImplicitlyImport ? symbols.filepath : symbols.document); |
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.
Now we use as a reference to the document the real path to the file on the file system.
ca11679
to
5ac7253
Compare
One thing we could do is to remove duplicates at the end, right before returning completion, what do you think? |
Yes, we can do it. The duplicates in the screenshot above looks like a bug. I will investigate this soon. |
UPD. This is a bug inside the
|
What is the purpose of this pull request?
Update the scanner service.
What changes did you make? (Give an overview)