Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 519611 - [lsp] DocumentHighlightKind is ignored for 'textDocument…
…/documentHighlight' requests

When processing the returned DocumentHighlight[] from the server, use
its kind property to determine whether we should mark it in Orion as
a read or write occurrence.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
  • Loading branch information
rcjsuen committed Jul 13, 2017
1 parent 7b5e2ca commit b289ea0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions bundles/org.eclipse.orion.client.ui/web/orion/lsp/ipc.js
Expand Up @@ -22,6 +22,16 @@ define([], function() {
Incremental: 2
});

/**
* The object of codes for a DocumentHighlight to indicate what
* what kind of highlighting it is.
*/
IPC.prototype.DOCUMENT_HIGHLIGHT_KIND = Object.freeze({
None: 1,
Read: 2,
Write: 3
});

/**
* The object of error codes
* @see https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#response-message
Expand Down
3 changes: 2 additions & 1 deletion bundles/org.eclipse.orion.client.ui/web/orion/lsp/utils.js
Expand Up @@ -81,7 +81,8 @@ define([
var offset = editor.getLineStart(result.range.start.line);
return {
start: result.range.start.character+offset,
end: result.range.end.character+offset
end: result.range.end.character+offset,
readAccess: result.kind === lspProviderImpl.ipc.DOCUMENT_HIGHLIGHT_KIND.Read
};
});
}
Expand Down

0 comments on commit b289ea0

Please sign in to comment.