Skip to content

Commit 39728c3

Browse files
Merge pull request #46 from atom-ide-community/fix/grammar-handling
fix: #43 use grammar scope name instead of grammar name
2 parents d0c1401 + 6b2b43c commit 39728c3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/datatip-manager.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ module.exports = class DatatipManager {
312312
this.dataTipMarkerDisposables = this.mountDataTipWithMarker(editor, datatip.range, position, dataTipView);
313313
}
314314
else if (datatip.markedStrings.length > 0) {
315-
const grammar = editor.getGrammar().name.toLowerCase();
315+
const grammar = editor.getGrammar().scopeName.toLowerCase();
316316
const snippetHtml = await this.getSnippetHtml(datatip.markedStrings.filter(t => t.type === 'snippet').map(t => t.value), grammar);
317317
const documentationHtml = await this.getDocumentationHtml(datatip.markedStrings.filter(t => t.type === 'markdown').map(t => t.value), grammar);
318318
const dataTipView = new DataTipView({ snippet: snippetHtml, html: documentationHtml });
@@ -339,7 +339,6 @@ module.exports = class DatatipManager {
339339
const preElem = document.createElement('pre');
340340
const codeElem = document.createElement('code');
341341
snippet = snippet.replace(/^\s*<(\?|!)([a-zA-Z]+)?\s*/i, ''); // remove any preamble from the line
342-
codeElem.classList.add(grammarName);
343342
codeElem.innerText = snippet.replace(regExpLSPPrefix, '');
344343
preElem.appendChild(codeElem);
345344
divElem.appendChild(preElem);

0 commit comments

Comments
 (0)