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

Extend analysis to to custom file extensions; folding for non-Dart files #2022

Merged
merged 1 commit into from
Sep 30, 2019
Merged

Extend analysis to to custom file extensions; folding for non-Dart files #2022

merged 1 commit into from
Sep 30, 2019

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Sep 24, 2019

To better support analyzer plugins on custom file endings, I've made two changes:

  1. Register providers that aren't specific to Dart (all those we register on MODE_HTML) for extensions declared in additionalAnalyzerFileExtensions if the option to use the Angular plugin is turned on.
  2. Use the analysis server folding for both html and custom files if enabled.

With a plugin I'm writing, I could verify that auto-complete, folding, outline, problems, fixes and navigation are all working with this setup.

Fixes #1981

Potential problems

In the linked issue, you asked whether the analysis server would send problematic responses when used with unsupported files. I played around with this as the plugin was turned off, and I didn't run into any problems.
Further, that shouldn't have any impact on the first change because it only effects users who explicitly added a file to additionalAnalyzerFileExtensions, which only makes sense when an appropriate plugin is available.

@DanTup
Copy link
Member

DanTup commented Sep 30, 2019

Thanks! This doesn't seem to include any changes to util.isAnalyzable though, so it seems like it would not transmit your code changes to the server?

@DanTup
Copy link
Member

DanTup commented Sep 30, 2019

Ugh, scratch that - it's already handled via additionalAnalyzerFileExtensions 😄

Thanks, I'll merge this for the next release!

@DanTup DanTup merged commit ee8818a into Dart-Code:master Sep 30, 2019
@DanTup DanTup added this to the v3.5.0 milestone Sep 30, 2019
@DanTup DanTup added in editor Relates to code editing or language features is enhancement labels Sep 30, 2019
@DanTup
Copy link
Member

DanTup commented Apr 6, 2020

When making some changes, I noticed here we only add from additionalAnalyzerFileExtensions if analyzeAnglularTemplates is enabled. This seems incorrect and I can't find any explanation, so I'm moving it out of that check (so disabling AnalyzeAngularTemplates would not also remove custom extensions).

If you can think of a reason why it was done that way and/or why this may be a bad idea, let me know!

@simolus3
Copy link
Contributor Author

simolus3 commented Apr 6, 2020

I think I was afraid to unconditionally enable them so that analyzeAngularTemplates is the flag that enables analyzer plugins. I don't think it will cause any harm to make them independent.

Either way, thanks for informing me! I'll update the docs of my analyzer plugin to reflect this.

@DanTup
Copy link
Member

DanTup commented Apr 6, 2020

Yeah I was thinking of renaming it, but it'd break people - but also, the flag is enabled by default so the risk seems low now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features is enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outline and folding not displaying when provided via analyzer plugin
2 participants