Skip to content

Commit

Permalink
fix: #43 use grammar scope name instead of grammar name
Browse files Browse the repository at this point in the history
  • Loading branch information
appelgriebsch committed Jun 21, 2019
1 parent d0c1401 commit 6b2b43c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/datatip-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ module.exports = class DatatipManager {
this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView);
}
else if (datatip.markedStrings.length > 0) {
const grammar = editor.getGrammar().name.toLowerCase();
const grammar = editor.getGrammar().scopeName.toLowerCase();
const snippetHtml = await this.getSnippetHtml(datatip.markedStrings.filter(t => t.type === 'snippet').map(t => t.value), grammar);
const documentationHtml = await this.getDocumentationHtml(datatip.markedStrings.filter(t => t.type === 'markdown').map(t => t.value), grammar);
const dataTipView = new DataTipView({ snippet: snippetHtml, html: documentationHtml });
Expand All @@ -339,7 +339,6 @@ module.exports = class DatatipManager {
const preElem = document.createElement('pre');
const codeElem = document.createElement('code');
snippet = snippet.replace(/^\s*<(\?|!)([a-zA-Z]+)?\s*/i, ''); // remove any preamble from the line
codeElem.classList.add(grammarName);
codeElem.innerText = snippet.replace(regExpLSPPrefix, '');
preElem.appendChild(codeElem);
divElem.appendChild(preElem);
Expand Down

0 comments on commit 6b2b43c

Please sign in to comment.