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

fix: compare URI case insensitive #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

powerman
Copy link

Neovim sends filenames to LSP as URI using lower case %-encoding.
For some tools (when entry.Filename is not empty) current implementation converts filename to URI (using upper case %-encoding) and then compare two URI in case-sensitive way.
This result in hard to notice issue: if filename contains non-ASCII symbols then some linters work (e.g. djlint) while others (e.g. markdownlint) doesn't work. And "doesn't work" here means Neovim gets no diagnostics even if there are some errors.

@@ -556,7 +556,8 @@ func (h *langHandler) lint(ctx context.Context, uri DocumentURI, eventType event
continue
}
} else {
if diagURI != uri && !config.LintWorkspace {
diagFname, _ := fromURI(diagURI)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is safe to ignore error here because diagURI is either uri (which already was checked for fromURI() error) or result of toURI()).

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.

1 participant