Skip to content

Worklog

Si Dunford edited this page Mar 31, 2022 · 41 revisions

This page will only be of interest to those of you who are following the development of the language server. It contains details of what is being worked on, testing and experimental information and issues that are encountered.

If you want to talk more about the content of the logs, please head over to the Discord chat and I'll pick up from there.

Currently working on:

  • Module scanner
  • BlitzMax Parser (INCLUDE and IMPORT bug)

Next Target

  • BlitzMax Parser

    • Add IF-THEN ✔️
      • ❓ Need to fix Comparison issue
    • 🐞 Fix issue with Comparison 🚧
    • 🐞 Fix issue with Expressions 🚧
    • 🐞 Fix FOR-NEXT expression ✖️
      • Add FOR-NEXT locals into symbol table
    • 🐞 Fix WHILE expression ✖️
    • 🐞 Fix REPEAT-UNTIL expression ✖️
    • Add RETURN 🚧
      • ❓ TESTING REQUIRED
  • Module scanner

    • Scan mod folder for valid modules ✔️
    • Create module cache database ✔️
    • Parse Modules ✔️
      • 🐞 Fix condition and expression in Parser 🚧
    • Extract public symbols/signature 🚧
      • Function, Method, Type
      • Enum, Struct, Const, Global
    • Add symbols to module cache
    • IMPORT must lookup symbols in module cache
      • Need workspace configuration working first, otherwise I have no start point
    • Identify non-included modules from unresolved functions.
      • Remember framework assistant? - A bit like that I guess
      • Need workspace configuration working first, otherwise I have no start point
  • Signature help

    • Enable experimental support
      • Enable example to check field requirements
      • expand database to include additional fields
      • expand symbol table to include signature
    • Lookup signature in symbol table and module symbol table
      • Return to client
  • Hover Provider

    • Enable experimental support ✔️
      • ❓ Currently disabled
      • Enable example to check field requirements ✔️
    • Lookup definition in symbol table and module symbol table
      • Return to client
  • Code Completion Provider (Autocorrect)

    • Enable experimental support ✔️
      • ❓ Currently disabled
      • Enable example to check field requirements ✔️
    • Identify further requirements
  • Outline View Options

    • Add argument to control constructor/destructor display (-o:desc) ✔️

    • Update TArguments to support numerical values instead of TRUE/FALSE

      • 📓 We need to support -o:new=
    • Update Outline view

      Detail -o:notype -o:descr Constructor Destructor
      Default n/a n/a Method New() Method Delete()
      No Prefix -o:notype n/a New() Delete()
      Descriptive Ignored -o:desc Constructor() Destructor()
  • Workspace configuration 🚧

    • Fix workspace/configuration message ✔️
    • Update Message receiver to cache sent requests and tie them to responses. ✔️
    • Create handler for workspace/configuration ✔️
    • Identify what section(s) I need to request in workspace/configuration request ❌
    • 🐞 Fix ServerRequest message timeout bug - FIXED ✔️
    • 🐞 distribute() sends error for ServerRequest - FIXED ✔️
    • Identify "MAIN" workspace source file ❌
    • Fix diagnostics to only report SuperStrict/Strict/Framework missing in MAIN file.
  • 🐞 Fix bug with cancel_request that I appear to have introduced! ❌

    • Handler was previously in TMessageQueue (Depreciated)
    • Need to move it to TLanguageServer

Workspace/Configuration

I am currently getting an error that I cannot source. Will look into this at a later date.

REQUEST

{
  "created": 12175058,
  "id": 0,
  "jsonrpc": "2.0",
  "method": "workspace/configuration",
  "params": [
    {
      "scopeUri": "file:///"
    }
  ]
}

RESPONSE

{
  "error": {
    "code": -32603,
    "message": "Request workspace/configuration failed with message: e.items is not iterable"
  },
  "id": 0,
  "jsonrpc": "2.0"
}

REQUEST

{
  "created": 36349039,
  "id": 1,
  "jsonrpc": "2.0",
  "method": "workspace/configuration",
  "params": [
    {
      "scopeUri": "file:///home/si/dev/example"
    }
  ]
}

RESPONSE

{
  "error": {
    "code": -32603,
    "message": "Request workspace/configuration failed with message: e.items is not iterable"
  },
  "id": 1,
  "jsonrpc": "2.0"
}

Experimental support for linting

  • HOW:
    • Initially this will only be keywords
    • Create linter TASK that is added as unique/low
    • Add AST.search( [tasks] ) that uses quick visitor (postboy) to create array of nodes
    • Use ast.search to find [TK_function, TK_Type etc.)
    • Lookup "CamelCase" version of the text
    • Compare with node text and linter|keywords configuration
    • send workspace/applyEdit (textedit) containing replacement text
  • NOTE: Linter should really only run after you type a space, :, ( etc and check last word/line (Autocorrect)

Autocomplete

I intend to progress this once the module scanner and symbol extraction has been completed

Signature Help

I intend to progress this once the module scanner and symbol extraction has been completed

Hover Provider

I intend to progress this once the module scanner and symbol extraction has been completed

Document Symbol Provider (Outline view / AST Option)

  • 🐞 Add IF-THEN support
  • 🐞 Add RETURN support
  • 🐞 Add PRIVATE support
  • 🐞 Add PUBLIC support
  • 🐞 Fix statement / assignment

Logging and settings

Potential EXIT issue:

14/11/21: It appears from the log that the application is quitting on Shutdown rather than Exit as I never receive the exit command and VSCODE reports an issue

[Trace - 09:16:27] Sending request 'textDocument/documentSymbol - (14)'.
[Error - 09:16:27] Connection to server is erroring. Shutting down server.
[Trace - 09:16:27] Sending request 'shutdown - (15)'.
[Trace - 09:16:27] Received notification 'textDocument/publishDiagnostics'.
[Trace - 09:16:27] Received response 'textDocument/documentSymbol - (14)' in 113ms.
[Trace - 09:16:27] Received response 'shutdown - (15)' in 172ms.
[Trace - 09:16:27] Sending notification 'exit'.
Error reading from stream

14-11-2021 09:16:27 DEBG TLSP_Stdio.getRequest() received 45 bytes
14-11-2021 09:16:27 DEBG - ID:      15
14-11-2021 09:16:27 DEBG - METHOD:  shutdown
14-11-2021 09:16:27 DEBG - TYPE:    REQUEST
14-11-2021 09:16:27 DEBG TClient.SendMessage()
{"id":"15","jsonrpc":"2.0","result":null}
14-11-2021 09:16:27 DEBG TLSP.SenderThread is awake
14-11-2021 09:16:27 DEBG TLSP.SenderThread going To sleep
14-11-2021 09:16:27 INFO Running Exit Procedure