coc-extensions / coc-fsharp

coc.nvim integration for fsharp-language-server
Other
32 stars 3 forks source link

Cant start coc-fsharp #6

Closed vushu closed 5 years ago

vushu commented 5 years ago

I not sure what happened but here is CocInfo


## versions

vim version: NVIM v0.3.1
node version: v8.10.0
coc.nvim version: 0.0.72-8c7241d7e3
term: xterm-kitty
platform: linux

## Messages

## Output channel: highlight
[Info  - 11:09:31] Highlight server running in node v8.10.0

## Output channel: fsharp
Listening on stdin

Couldn't find System.ComponentModel.Composition.dll in /home/vushu/.config/coc/extensions/node_modules/coc-fsharp/out/server/linux-x64
Add workspace root /home/vushu/coding/fsharp/sharptd
output: 2.1.700 [/usr/share/dotnet/sdk]
output: 2.2.300 [/usr/share/dotnet/sdk]
dotnet pack folders: ["/usr/share/dotnet/packs"]
New configuration {
  "trace": {
    "server": "off"
  },
  "project": {
    "define": [],
    "otherFlags": [],
    "includeCompileBefore": false
  },
  "codelens": {
    "references": true
  }
}
analyzeLater: /home/vushu/coding/fsharp/sharptd/build.fsx
analyzeLater: /home/vushu/coding/fsharp/sharptd/sharptd.fsproj
analyzeLater: /home/vushu/coding/fsharp/sharptd/Source/test.fsx
No cracked project references RenderSystem.fs, looking at uncracked projects...
The text of sharptd.fsproj contains the string 'RenderSystem.fs', cracking
Analyzing sharptd.fsproj
Failed to build sharptd.fsproj: Could not load project /home/vushu/coding/fsharp/sharptd/sharptd.fsproj in ProjectCollection. Available tools: ["/usr/share/dotnet/sdk/2.2.300 "]. Message: The SDK 'Microsoft.NET.Sdk' specified could not be found.
--------- Project references -----------------
---------- otherProjectReferences ----------------
----------- packageReferences ---------------
----------- directReferences ---------------
----------- systemReferences ---------------
----------- ConditionalCompilationDefines ---------------
----------- OtherCompilerFlags ---------------
--------------------------
/home/vushu/coding/fsharp/sharptd/sharptd.fsproj: 
  ProjectFileName: "/home/vushu/coding/fsharp/sharptd/sharptd.fsproj"
  SourceFiles: [||]
  ReferencedProjects: []
  OtherOptions: [|"--noframework"|]
  LoadTime: 7/9/19 10:57:52 AM
  ExtraProjectInfo: <null>
  IsIncompleteTypeCheckEnvironment: false
  OriginalLoadReferences: []
  ExtraProjectInfo: <null>
  Stamp: <null>
  UnresolvedReferences: <null>
  UseScriptResolutionRules: false
No cracked project references RenderSystem.fs, looking at uncracked projects...
Autocompleting at /home/vushu/coding/fsharp/sharptd/Source/Systems/RenderSystem.fs(27,5)
No cracked project references RenderSystem.fs, looking at uncracked projects...
Finished typecheck, looking for completions...
Check failed, ignored 1 errors
No cracked project references RenderSystem.fs, looking at uncracked projects...
Autocompleting at /home/vushu/coding/fsharp/sharptd/Source/Systems/RenderSystem.fs(27,18)
No cracked project references RenderSystem.fs, looking at uncracked projects...
Finished typecheck, looking for completions...
Check failed, ignored 1 errors
No cracked project references RenderSystem.fs, looking at uncracked projects...
yatli commented 5 years ago

the project file is not parsing correctly. is it working on a simpler project?

vushu commented 5 years ago

I have this problem with any fsharp project, not sure why how this happened, maybe after I have updated to dotnet core 2.2.

elafarge commented 5 years ago

:+1: I'm getting the very same errors in :CocInfo on a very simple project.

Steps to reproduce:

CocList diagnostics shows

1 src/MyConsoleApp/Program.fs:1:1 Error [fsharp] No .fsproj or .fsx file references /redacted/src/MyConsoleApp/Program.fs

Is there any way I could help figure out why the project file isn't parsing correctly ?

yatli commented 5 years ago

I think I have some clue now. It's about msbuild not finding the tool set. I'll see if I can repro this problem.

yatli commented 5 years ago

Hang on.

yatli commented 5 years ago

Ok I can repro this on WSL. Looking into it.

yatli commented 5 years ago

https://github.com/yatli/coc-fsharp/commit/f8f7cb332a6cc9ad38c754ee39279f8ca070f29e#diff-13c71099093e892021cc44da994dc763R202

They decided to add a space to dotnet --info in 2.2

yatli commented 5 years ago

@elafarge @vushu pushed out 0.1.52 on npm. Feel free to reopen if the problem persists.

vushu commented 5 years ago

Now im getting this error:

## versions

vim version: NVIM v0.3.1
node version: v8.10.0
coc.nvim version: 0.0.72-b24601e6af
term: xterm-kitty
platform: linux

## Messages
[coc.nvim] Error on active extension coc-fsharp: TypeError: mode must be an integer
yatli commented 5 years ago

@vushu I'm not sure what happened. Any detailed logs?

vushu commented 5 years ago

I only get the info above when doing CocInfo

I first did a CocUninstall coc-fsharp then CocInstall coc-fsharp then the error occurs when opening just a simple fsharp project.

in my .config/coc/extensions/node_modules/coc-sharp/package.json I am using your latest version 0.1.52:

{
    "name": "coc-fsharp",
    "displayName": "F# Language Server for coc.nvim",
    "description": "F# Language Support using FSharp Compiler Services",
    "author": "Yatao Li",
    "license": "MIT",
    "icon": "Icon512.png",
    "version": "0.1.52",
    "publisher": "yatli",
    "repository": {
        "type": "git",
        "url": "https://github.com/yatli/fsharp-language-server"
    },
    "engines": {
        "coc": ">=0.0.71"
    },
    "keywords": [
        "fsharp",
        "coc.nvim",
        "dotnet",
        ".NET Core",
        ".NET"
    ],
    "categories": [
        "Programming Languages",
        "Linters",
        "coc.nvim"
    ],
    "activationEvents": [
        "onLanguage:fsharp"
    ],
    "main": "out/client/extension.js",
    "files": [
        "out",
        "syntaxes"
    ],
    "contributes": {
        "languages": [
            {
                "id": "fsharp",
                "aliases": [
                    "F#",
                    "FSharp",
                    "fsharp"
                ],
                "extensions": [
                    ".fs",
                    ".fsx",
                    ".fsi",
                    ".fsl",
                    ".fsy"
                ],
                "configuration": "syntaxes/fsharp.configuration.json"
            }
        ],
        "grammars": [
            {
                "language": "fsharp",
                "scopeName": "source.fsharp",
                "path": "syntaxes/fsharp.json"
            },
            {
                "language": "fsharp",
                "scopeName": "source.fsharp.fsx",
                "path": "syntaxes/fsharp.fsx.json"
            },
            {
                "language": "fsharp",
                "scopeName": "source.fsharp.fsi",
                "path": "syntaxes/fsharp.fsi.json"
            }
        ],
        "configuration": {
            "type": "object",
            "title": "FSharp configuration",
            "properties": {
                "fsharp.trace.server": {
                    "scope": "application",
                    "type": "string",
                    "enum": [
                        "off",
                        "messages",
                        "verbose"
                    ],
                    "default": "off",
                    "description": "Traces the communication between VSCode and the language server."
                },
                "fsharp.project.define": {
                    "scope": "resource",
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "default": [],
                    "description": "Specifies macro definitions for a F# project."
                },
                "fsharp.project.otherFlags": {
                    "scope": "resource",
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "default": [],
                    "description": "Specifies other fsc flags."
                },
                "fsharp.project.includeCompileBefore": {
                    "scope": "resource",
                    "type": "boolean",
                    "default": false,
                    "description": "Treat <CompileBefore ../> items in the project as source files."
                },
                "fsharp.codelens.references": {
                    "scope": "resource",
                    "type": "boolean",
                    "default": true,
                    "description": "Display the number of references for the symbols. Uses more resources and may crash coc.nvim for very large projects."
                }
            }
        }
    },
    "scripts": {
        "compile": "tsc -p ./",
        "watch": "tsc -watch -p ./"
    },
    "extensionDependencies": [],
    "dependencies": {
        "vscode-jsonrpc": "*",
        "vscode-languageserver-protocol": "*"
    },
    "devDependencies": {
        "@types/node": "^10.3.3",
        "typescript": "^3.0.3",
        "coc.nvim": "^0.0.71"
    }
}
yatli commented 5 years ago

uh oh I think I see what happened It's about fs.chmodSync

yatli commented 5 years ago

try 0.1.53 :)

vushu commented 5 years ago

It works now, thank you :)