Skip to content

Commit 7b45a82

Browse files
ZweZeyaRichDom2185
andauthored
2748 remove hints type inference (#2755)
* remove type hints * remove type inferences cleanup * remove key binding for type information --------- Co-authored-by: Richard Dominick <34370238+RichDom2185@users.noreply.github.com>
1 parent 8896343 commit 7b45a82

File tree

4 files changed

+2
-83
lines changed

4 files changed

+2
-83
lines changed

src/commons/editor/Editor.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import useHighlighting from './UseHighlighting';
2020
import useNavigation from './UseNavigation';
2121
import useRefactor from './UseRefactor';
2222
import useShareAce from './UseShareAce';
23-
import useTypeInference from './UseTypeInference';
2423
import { getModeString, selectMode } from '../utils/AceHelper';
2524
import { EditorBinding } from '../WorkspaceSettingsContext';
2625
import { IAceEditor } from 'react-ace/lib/types';
@@ -570,7 +569,7 @@ const EditorBase = React.memo((props: EditorProps & LocalStateProps) => {
570569
});
571570

572571
// don't create a new list every render.
573-
const hooks = [useHighlighting, useNavigation, useTypeInference, useShareAce, useRefactor];
572+
const hooks = [useHighlighting, useNavigation, useShareAce, useRefactor];
574573

575574
const Editor: React.FC<EditorProps> = (props: EditorProps) => {
576575
const [sessions, setSessions] = React.useState<Record<string, Ace.EditSession>>({});

src/commons/editor/EditorHotkeys.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ export const keyBindings = {
1414
highlightScope: {
1515
win: 'Ctrl-Shift-H',
1616
mac: 'Command-Shift-H'
17-
},
18-
typeInferenceDisplay: {
19-
win: 'Ctrl-Shift-M',
20-
mac: 'Command-Shift-M'
2117
}
2218
};
2319

src/commons/editor/UseTypeInference.tsx

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/commons/sagas/WorkspaceSaga.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
findDeclaration,
55
getNames,
66
interrupt,
7-
parseError,
87
Result,
98
resume,
109
runFilesInContext,
@@ -15,9 +14,7 @@ import { defineSymbol } from 'js-slang/dist/createContext';
1514
import { InterruptedError } from 'js-slang/dist/errors/errors';
1615
import { parse } from 'js-slang/dist/parser/parser';
1716
import { manualToggleDebugger } from 'js-slang/dist/stdlib/inspector';
18-
import { typeCheck } from 'js-slang/dist/typeChecker/typeChecker';
1917
import { Chapter, Variant } from 'js-slang/dist/types';
20-
import { validateAndAnnotate } from 'js-slang/dist/validator/validator';
2118
import { random } from 'lodash';
2219
import Phaser from 'phaser';
2320
import { SagaIterator } from 'redux-saga';
@@ -1241,22 +1238,9 @@ export function* evalCode(
12411238
// Safe to use ! as storyEnv will be defined from above when we call from EVAL_STORY
12421239
yield put(actions.evalStoryError(context.errors, storyEnv!));
12431240
}
1244-
// we need to parse again, but preserve the errors in context
1245-
const oldErrors = context.errors;
1246-
context.errors = [];
1247-
// Note: Type checking does not support multiple file programs.
1248-
const parsed = parse(entrypointCode, context);
1249-
const typeErrors = parsed && typeCheck(validateAndAnnotate(parsed!, context), context)[1];
1250-
context.errors = oldErrors;
1251-
// for achievement event tracking
1241+
12521242
const events = context.errors.length > 0 ? [EventType.ERROR] : [];
12531243

1254-
if (typeErrors && typeErrors.length > 0 && !isStoriesBlock) {
1255-
events.push(EventType.ERROR);
1256-
yield put(
1257-
actions.sendReplInputToOutput('Hints:\n' + parseError(typeErrors), workspaceLocation)
1258-
);
1259-
}
12601244
yield put(actions.addEvent(events));
12611245
return;
12621246
} else if (result.status === 'suspended' || result.status === 'suspended-ec-eval') {

0 commit comments

Comments
 (0)