This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix conversion from Windows UNC paths to file URI format.
AbandonedPublic

Authored by ilya-golovenko on Jul 20 2020, 5:04 AM.

Details

Summary

The fix improves handling of Windows UNC paths to align with Appendix E. Nonstandard Syntax Variations of RFC 8089.

Before this fix it was difficult to use Windows UNC paths in compile_commands.json database as such paths were converted to file URIs using 'file:////auth/share/file.cpp' notation instead of recommended 'file://auth/share/file.cpp'.

As an example, VS.Code cannot understand file URIs with 4 starting slashes, thus such features as go-to-definition, jump-to-file, hover tooltip, etc. stop working. This also applicable to files which reside on Windows network-mapped drives because clangd internally resolve file paths to real paths in some cases and such path get resolved to UNC paths.

Diff Detail

Event Timeline

walrus created this revision.Jul 20 2020, 5:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2020, 5:04 AM
ilya-golovenko edited the summary of this revision. (Show Details)Jul 20 2020, 5:09 AM
ilya-golovenko added reviewers: sammccall, kadircet.
ilya-golovenko added a project: Restricted Project.

This is an attempt to improve handling of Windows UNC paths in clangd. Any feedback is appreciated.

ilya-golovenko edited the summary of this revision. (Show Details)Jul 20 2020, 5:16 AM

Consistent naming: Name => Path

ilya-golovenko commandeered this revision.Jul 20 2020, 6:55 AM
ilya-golovenko added a reviewer: walrus.
ilya-golovenko removed a reviewer: walrus.

Consistent naming: hasDriveLetter => isWindowsPath

ilya-golovenko abandoned this revision.Jul 20 2020, 7:12 AM