pull/2908/head
filip mertens 2 years ago
parent 69897539b7
commit 194841572a
  1. 6
      apps/remix-ide/src/app/plugins/parser/code-parser.tsx
  2. 4
      apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts

@ -73,7 +73,7 @@ export class CodeParser extends Plugin {
getLastNodeInLine: (ast: string) => Promise<any>
listAstNodes: () => Promise<any>
getANTLRBlockAtPosition: (position: any, text?: string) => Promise<any>
getCurrentFileAST: (text?: string) => Promise<ParseResult>
setCurrentFileAST: (text?: string) => Promise<ParseResult>
constructor(astWalker: any) {
super(profile)
@ -109,7 +109,7 @@ export class CodeParser extends Plugin {
this.getLastNodeInLine = this.antlrService.getLastNodeInLine.bind(this.antlrService)
this.listAstNodes = this.antlrService.listAstNodes.bind(this.antlrService)
this.getANTLRBlockAtPosition = this.antlrService.getANTLRBlockAtPosition.bind(this.antlrService)
this.getCurrentFileAST = this.antlrService.getCurrentFileAST.bind(this.antlrService)
this.setCurrentFileAST = this.antlrService.setCurrentFileAST.bind(this.antlrService)
this.on('editor', 'didChangeFile', async (file) => {
@ -126,7 +126,7 @@ export class CodeParser extends Plugin {
await this.call('editor', 'discardLineTexts')
const completionSettings = await this.call('config', 'getAppParameter', 'auto-completion')
if (completionSettings) {
this.antlrService.getCurrentFileAST()
this.antlrService.setCurrentFileAST()
}
await this.handleChangeEvents()
})

@ -85,7 +85,7 @@ export default class CodeParserAntlrService {
enableWorker() {
if (!this.workerTimer) {
this.workerTimer = setInterval(() => {
this.getCurrentFileAST()
this.setCurrentFileAST()
}, 5000)
}
}
@ -118,7 +118,7 @@ export default class CodeParserAntlrService {
* @param text
* @returns
*/
async getCurrentFileAST(text: string | null = null) {
async setCurrentFileAST(text: string | null = null) {
try {
this.plugin.currentFile = await this.plugin.call('fileManager', 'file')
if (this.plugin.currentFile && this.plugin.currentFile.endsWith('.sol')) {

Loading…
Cancel
Save