Skip to content

Commit

Permalink
Merge pull request #581 from lgeiger/fix-magicpython
Browse files Browse the repository at this point in the history
Fix autocomplete when using MagicPython
  • Loading branch information
rgbkrk authored Jan 11, 2017
2 parents ccbf5c6 + 8bd3da6 commit 280ef02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/autocomplete-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import _ from 'lodash';
import log from './log';
import Config from './config';

const iconHTML = `<img src='${__dirname}/../static/logo.svg' style='width: 100%;'>`;

Expand Down Expand Up @@ -43,7 +44,11 @@ export default function (kernelManager) {
bufferPosition,
]);

const regex = regexes[language];
// Support none default grammars like magicpython
const languageMappings = Config.getJson('languageMappings');
const mappedLanguage = _.findKey(languageMappings, l => l === language);

const regex = regexes[language] || regexes[mappedLanguage];
if (regex) {
prefix = _.head(line.match(regex)) || '';
} else {
Expand Down

0 comments on commit 280ef02

Please sign in to comment.