Skip to content

Commit

Permalink
fix: intellisense not working (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Apr 22, 2021
1 parent 980284a commit e6006fb
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/main/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export function getMainWindowOptions(): Electron.BrowserWindowConstructorOptions
webPreferences: {
webviewTag: false,
nodeIntegration: true,
nodeIntegrationInWorker: true,
contextIsolation: false,
preload: path.join(__dirname, '..', 'preload', 'preload'),
},
Expand Down
16 changes: 2 additions & 14 deletions src/renderer/npm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { EditorValues } from '../interfaces';
import { exec } from '../utils/exec';
import decomment from 'decomment';

// Making TypeScript happy and avoiding "esModuleInterop" issues
const { builtinModules } = require('module');
Expand Down Expand Up @@ -111,7 +112,7 @@ export async function findModules(input: string) {
let match: RegExpMatchArray | null;

/* decomment code with the esprima parser */
const code = await decommentWithWorker(input);
const code = await decomment(input);

/* grab all global require matches in the text */
while ((match = requiregx.exec(code) || null)) {
Expand Down Expand Up @@ -166,16 +167,3 @@ export function packageRun(
): Promise<string> {
return exec(dir, `${packageManager} run ${command}`);
}

function decommentWithWorker(input: string): Promise<string> {
return new Promise((resolve, reject) => {
const worker = new Worker('../utils/decomment.ts');
worker.onmessage = function (event: MessageEvent<string>) {
resolve(event.data);
};
worker.postMessage(input);
worker.onerror = function (e) {
reject(e);
};
});
}
5 changes: 0 additions & 5 deletions src/utils/decomment.ts

This file was deleted.

1 change: 0 additions & 1 deletion tests/main/windows-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe('windows', () => {
webPreferences: {
webviewTag: false,
nodeIntegration: true,
nodeIntegrationInWorker: true,
contextIsolation: false,
preload: '/fake/path',
},
Expand Down
3 changes: 0 additions & 3 deletions tests/renderer/npm-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ import {
} from '../../src/renderer/npm';
import { exec } from '../../src/utils/exec';
import { overridePlatform, resetPlatform } from '../utils';
import MockDecommentWorker from '../mocks/worker';
import { DefaultEditorId } from '../../src/interfaces';
jest.mock('decomment');
jest.mock('../../src/utils/exec');

window.Worker = MockDecommentWorker;

describe('npm', () => {
const mockBuiltins = `
function hello() {
Expand Down

0 comments on commit e6006fb

Please sign in to comment.