castwide / solargraph

A Ruby language server.

Home Page:https://solargraph.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I encountered an issue where code completion becomes abnormal after Solargraph receives the workspace/didChangeWorkspaceFolders request.

bluesaiz opened this issue · comments

Currently, I am facing an issue where if solargraph receive a workspace/didChangeWorkspaceFolders request with the same folder in both the "added" and "removed" fields, such as in the following message:

jsonCopy code{
    "jsonrpc": "2.0",
    "method": "workspace/didChangeWorkspaceFolders",
    "params": {
        "event": {
            "added": [
                {
                    "uri": "file:///home/name/solargraph_test",
                    "name": "workpath"
                }
            ],
            "removed": [
                {
                    "uri": "file:///home/name/solargraph_test",
                    "name": "workpath"
                }
            ]
        }
    }
}

I found the current code handling is problematic:

def process
    add_folders
    remove_folders  
end

image

maybe changed to:

def process
    remove_folders  
    add_folders
end

in order to handle more cases.