This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Support utf-8 offsets (rather than utf-16) as a protocol extension
ClosedPublic

Authored by sammccall on Feb 15 2019, 2:16 AM.

Details

Diff Detail

Event Timeline

sammccall created this revision.Feb 15 2019, 2:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2019, 2:16 AM

The code looks good. For this protocol extension, we need supports from other LSP clients, I think we may want to propose this extension to the LSP specification, so that all LSP servers/clients respect it.

clangd/Protocol.h
385

nit: also mention this is in preferred order.

The code looks good. For this protocol extension, we need supports from other LSP clients, I think we may want to propose this extension to the LSP specification, so that all LSP servers/clients respect it.

My reading of https://github.com/Microsoft/language-server-protocol/issues/376 is that they may only accept a proposal that comes with patches to Microsoft's implementations.
I'm not likely to work on that soon (it doesn't directly get us closer to interop goals) so my preferred path is implement and document the extension, get some support from other language clients/servers, and then push again for standardization.

sammccall updated this revision to Diff 187002.Feb 15 2019, 6:07 AM

Add tests, command-line flag, and misc cleanups.
No flag for clangd-indexer yet. It's surprisingly hard with the executor API :-(

hokein accepted this revision.Feb 18 2019, 7:32 AM

I think we need to update the comment in the SymbolLocation::Column.

clangd/tool/ClangdMain.cpp
9

the #include introduced by global code completion seems not get shortened.

This revision is now accepted and ready to land.Feb 18 2019, 7:32 AM
This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.