Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
uses: golangci/golangci-lint-action@v2
with:
version: v1.27
version: v1.29
- name: Setup Go
uses: actions/setup-go@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions tools/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ func analyzePackage(sdkDir, pathName string) ([]Package, error) {
}

pkg.Children, err = analyzeDir(sdkDir, pathName)
if err != nil {
return nil, fmt.Errorf("failed to analyze package %q: %w", pkg.Name, err)
}

pkgs = append(pkgs, pkg)
}
return pkgs, nil
Expand Down
45 changes: 26 additions & 19 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,31 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.0",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"axios": "^0.21.1",
"circular-dependency-plugin": "^5.2.0",
"connected-react-router": "^6.6.1",
"file-saver": "^2.0.2",
"monaco-editor": "^0.20.0",
"monaco-editor-webpack-plugin": "^1.9.0",
"circular-dependency-plugin": "^5.2.2",
"connected-react-router": "^6.9.2",
"file-saver": "^2.0.5",
"monaco-editor": "^0.32.1",
"monaco-editor-webpack-plugin": "^7.0.1",
"office-ui-fabric-react": "^7.82.1",
"react": "^16.12.0",
"react": "^17.0.2",
"react-app-rewired": "^2.1.5",
"react-dom": "^16.12.0",
"react-monaco-editor": "^0.39.1",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"typescript": "^3.7.4",
"uuid": "^3.4.0"
"react-dom": "^17.0.2",
"react-monaco-editor": "^0.47.0",
"react-redux": "^7.2.6",
"react-router-dom": "^5.3.0",
"react-scripts": "5.0.0",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"typescript": "^4.5.5",
"uuid": "^3.4.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "GENERATE_SOURCEMAP=true react-app-rewired start",
Expand All @@ -33,7 +37,10 @@
"gen:suggestions": "node ./src/editor/internal/genpkgcache.js"
},
"eslintConfig": {
"extends": "react-app"
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion web/src/editor/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class CodeEditor extends React.Component<any, CodeEditorState> {
label: 'Format Code (goimports)',
contextMenuGroupId: 'navigation',
keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KEY_F
monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KeyF
],
run: (ed, ...args) => {
this.props.dispatch(formatFileDispatcher);
Expand Down
2 changes: 1 addition & 1 deletion web/src/editor/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class GoCompletionItemProvider implements monaco.languages.CompletionItemProvide
return {
suggestions: relatedSnippets.concat(suggestions.map(s => ({...s, range})))
}
} catch (err) {
} catch (err: any) {
console.error(`Failed to get code completion from server: ${err.message}`);
return {suggestions: relatedSnippets};
}
Expand Down
8 changes: 5 additions & 3 deletions web/src/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function setThemeStyles(isDark: boolean) {
export const getVariableValue = (key: string, defaultValue: string) =>
process.env[`REACT_APP_${key}`] ?? defaultValue;

export default {
const Config = {
_cache: {},
appVersion: getVariableValue('VERSION', '1.0.0'),
serverUrl: getVariableValue('LANG_SERVER', window.location.origin),
Expand Down Expand Up @@ -142,6 +142,8 @@ export default {
},

forceRefreshPage() {
document.location.reload(true);
// document.location.reload(true);
}
};
};

export default Config;
8 changes: 4 additions & 4 deletions web/src/services/go/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ export class Go {
if (!this.mem) return;
const code = this.mem.getInt32(sp + 8, true);
this.exited = true;
delete this._inst;
delete this._values;
delete this._goRefCounts;
delete this._ids;
delete this._inst; // @ts-ignore
delete this._values; // @ts-ignore
delete this._goRefCounts; // @ts-ignore
delete this._ids; // @ts-ignore
delete this._idPool;
this.exit(code);
},
Expand Down
8 changes: 4 additions & 4 deletions web/src/store/dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function newSnippetLoadDispatcher(snippetID: string): Dispatcher {
const resp = await client.getSnippet(snippetID);
const { fileName, code } = resp;
dispatch(newImportFileAction(fileName, code));
} catch(err) {
} catch(err: any) {
dispatch(newErrorAction(err.message));
}
}
Expand All @@ -91,7 +91,7 @@ export const shareSnippetDispatcher: Dispatcher =
const {code} = getState().editor;
const res = await client.shareSnippet(code);
dispatch(push(`/snippet/${res.snippetID}`));
} catch (err) {
} catch (err: any) {
dispatch(newErrorAction(err.message));
}
};
Expand Down Expand Up @@ -132,7 +132,7 @@ export const runFileDispatcher: Dispatcher =
default:
dispatch(newErrorAction(`AppError: Unknown Go runtime type "${settings.runtime}"`));
}
} catch (err) {
} catch (err: any) {
dispatch(newErrorAction(err.message));
}
};
Expand All @@ -147,7 +147,7 @@ export const formatFileDispatcher: Dispatcher =
if (res.formatted) {
dispatch(newBuildResultAction(res));
}
} catch (err) {
} catch (err: any) {
dispatch(newErrorAction(err.message));
}
};
Expand Down
1 change: 1 addition & 0 deletions web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"jsx": "react",
"noImplicitAny": false,
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
Expand Down
Loading