Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin is not working #19

Closed
esn89 opened this issue Jun 20, 2020 · 15 comments
Closed

Plugin is not working #19

esn89 opened this issue Jun 20, 2020 · 15 comments
Labels
question Further information is requested

Comments

@esn89
Copy link

esn89 commented Jun 20, 2020

nvim version:

NVIM v0.4.3
Build type: Release
Lua 5.3
Compilation: /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_UNIBI_HAS_VAR_FROM -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/config -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/neovim-0.4.3/src -I/opt/local/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/src/nvim/auto -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/include
Compiled by macports@catalina.internal.macports.net

Features: +acl +iconv +tui

Using coc-yaml@1.0.4

When I have a .yaml file open in vim, I check the process tree (ps aux | grep yaml) and I see the server.js start:

esn89              7618   0.0  0.3  4632184  49360   ??  S    11:14PM   0:00.49 /opt/local/bin/node /Users/esn89/.config/coc/extensions/node_modules/coc-yaml/node_modules/yaml-language-server/out/server/src/server.js --node-ipc --node-ipc --clientProcessId=6969

Output of :CocOpenLog:

2020-06-19T23:16:44.209 INFO (pid:7862) [services] - registered service "languageserver.bash"
2020-06-19T23:16:44.246 INFO (pid:7862) [services] - registered service "yaml"
2020-06-19T23:16:44.247 INFO (pid:7862) [services] - yaml server state change: stopped => starting
2020-06-19T23:16:44.248 INFO (pid:7862) [plugin] - coc.nvim 0.0.78 initialized with node: v10.21.0 after 180ms
2020-06-19T23:16:44.251 INFO (pid:7862) [language-client-index] - yaml started with 7916
2020-06-19T23:16:44.432 INFO (pid:7862) [services] - yaml server state change: starting => running
2020-06-19T23:16:44.439 INFO (pid:7862) [services] - service yaml started

And this is what my :CocConfig looks like:

{
	"diagnostic.errorSign": " ", "diagnostic.warningSign": "⚠",
	"diagnostic.infoSign": "☞",
	"diagnostic.hintSign": "☀",
	"diagnostic.displayByAle": true,
	"coc.preferences.hoverTarget": "float",
	"coc.preferences.formatOnSaveFiletypes": ["go"],
	"list.insertMappings": {
		"<C-x>": "action:split",
		"<C-s>": "action:vsplit"
	},
	"list.normalMappings": {
		"<C-x>": "action:split",
		"<C-s>": "action:vsplit"
	},
	"suggest.timeout": 500,
	"suggest.completionItemKindLabels": {
		"variable": "⬥",
		"function": "𝑓",
		"class": "↣",
		"interface": "☍",
		"module": "{}",
		"keyword": "≔",
		"property": "⚲",
		"value": "◰",
		"enum": "◰",
		"field": "☐",
		"method": "𝑓",
		"file": "\uf24a",
		"folder": "\uf114"
	},
	"python.linting.flake8Path": "/Users/esn89/Library/Python/3.7/bin/flake8",
	"python.linting.flake8Enabled": true,
	"python.linting.enabled": false,
	"python.jediEnabled": false,
	"python.sortImports.path": "/Users/esn89/Library/Python/3.7/bin/isort",
	"yaml.trace.server": "verbose",
	"yaml.customTags": [
		"!Ref",
		"!GetAtt",
		"!fn",
		"!And",
		"!And sequence",
		"!If",
		"!Condition sequence",
		"!Condition scalar",
		"!If sequence",
		"!Not sequence",
		"!Equals sequence",
		"!Or",
		"!FindInMap sequence",
		"!Base64",
		"!Cidr",
		"!Sub sequence",
		"!Sub scalar",
		"!GetAZs",
		"!ImportValue",
		"!Select",
		"!Split",
		"!stack_output_external",
		"!stack_output",
		"!Join sequence"
	],
	"yaml.trace.server": "verbose",
	"yaml.validate": true,
	"yaml.completion": true,
	"yaml.format.enable": true,
	"languageserver": {
	  "bash": {
	    "command": "bash-language-server",
	    "args": ["start"],
	    "filetypes": ["sh"],
	    "ignoredRootPaths": ["~"]
		}
	}
}

Any help would be appreciated.

@chemzqm chemzqm added the question Further information is requested label Jun 20, 2020
@chemzqm
Copy link
Member

chemzqm commented Jun 20, 2020

Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

@esn89
Copy link
Author

esn89 commented Jun 20, 2020

Can I clarify this:
Do I need to set up the config in the "languageserver": {} block?

I thought I do not need to if I install it as an extension via :CocInstall coc-yaml

I have added like this:

	"yaml.validate": true,
	"yaml.completion": true,
	"yaml.format.enable": true,
	"yaml.trace.server": "verbose",
	"languageserver": {

:CocOpenLog still shows the same.

@maulanakmal
Copy link

not working

@esn89
Copy link
Author

esn89 commented Jul 29, 2020

Also wondering: is this deprecated/not supported anymore? If so, I would have to move over to ALE to support Yaml linting

@pbnj
Copy link

pbnj commented Aug 22, 2020

@esn89

Do I need to set up the config in the "languageserver": {} block?

No.

:CocOpenLog still shows the same

I don't see a problem in your logs.

Can you please tell us what you're trying to do or what is not meeting your expectations?

@esn89
Copy link
Author

esn89 commented Aug 24, 2020

The problem I am facing is that, if I have a file that is not valid yaml, it does not warn me or raise an error.

@pbnj
Copy link

pbnj commented Aug 24, 2020

@esn89 - can you provide an example yaml? I use coc-yaml and it reports warnings and errors for me.

@esn89
Copy link
Author

esn89 commented Aug 24, 2020

Here you go:

version: 3
automerge: false
projects:
  asdfa
- name: bob
  dir: ../Music
  workspace: default
  apply_requirements: ["done", "finished"

I expect it to highlight "asdfa" since it isn't really valid. And to highlight the missing bracket after "finished".

And the :CocOpenLog

2020-08-24T13:07:17.796 WARN (pid:52192) [attach] - Plugin not ready when received "highlight" []
2020-08-24T13:07:18.047 INFO (pid:52192) [services] - registered service "yaml"
2020-08-24T13:07:18.049 INFO (pid:52192) [services] - yaml server state change: stopped => starting
2020-08-24T13:07:18.051 INFO (pid:52192) [plugin] - coc.nvim 0.0.78 initialized with node: v10.22.0 after 225ms
2020-08-24T13:07:18.056 INFO (pid:52192) [language-client-index] - yaml started with 52268
2020-08-24T13:07:18.380 INFO (pid:52192) [services] - yaml server state change: starting => running
2020-08-24T13:07:18.387 INFO (pid:52192) [services] - service yaml started
2020-08-24T13:07:29.941 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:33.278 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:33.838 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:35.247 INFO (pid:52192) [completion-complete] - Results from: file
2020-08-24T13:07:37.067 INFO (pid:52192) [willSaveHandler] - Will save cost: 63
2020-08-24T13:07:43.441 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:44.109 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:44.254 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:44.388 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:45.374 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:45.543 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:45.677 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:45.820 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:45.978 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:47.043 INFO (pid:52192) [willSaveHandler] - Will save cost: 63
2020-08-24T13:07:51.169 INFO (pid:52192) [willSaveHandler] - Will save cost: 61
2020-08-24T13:07:53.170 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:53.347 INFO (pid:52192) [completion-complete] - Results from: around
2020-08-24T13:07:54.233 INFO (pid:52192) [willSaveHandler] - Will save cost: 64

@pbnj
Copy link

pbnj commented Aug 25, 2020

Seems to be working for me.

:CocOpenLog

2020-08-24T21:47:44.270 INFO (pid:42096) [services] - registered service "languageserver.bash"
2020-08-24T21:47:44.272 INFO (pid:42096) [services] - registered service "languageserver.dockerfile"
2020-08-24T21:47:44.272 INFO (pid:42096) [services] - registered service "languageserver.golang"
2020-08-24T21:47:44.272 INFO (pid:42096) [services] - registered service "languageserver.terraform"
2020-08-24T21:47:44.287 INFO (pid:42096) [services] - registered service "eslint"
2020-08-24T21:47:44.451 INFO (pid:42096) [services] - registered service "highlight"
2020-08-24T21:47:44.594 INFO (pid:42096) [services] - registered service "yaml"
2020-08-24T21:47:44.594 INFO (pid:42096) [services] - yaml server state change: stopped => starting
2020-08-24T21:47:44.610 INFO (pid:42096) [language-client-index] - highlight started with 42103
2020-08-24T21:47:44.618 INFO (pid:42096) [language-client-index] - yaml started with 42104
2020-08-24T21:47:44.622 INFO (pid:42096) [plugin] - coc.nvim 0.0.78-bdd9a9e140 initialized with node: v12.16.3 after 417ms
2020-08-24T21:47:44.750 INFO (pid:42096) [services] - yaml server state change: starting => running
2020-08-24T21:47:44.751 INFO (pid:42096) [services] - service yaml started

Screenshots

Vim

Screen Shot 2020-08-24 at 9 45 02 PM

VS Code

Screen Shot 2020-08-24 at 9 43 50 PM

@esn89
Copy link
Author

esn89 commented Aug 25, 2020

@pbnj

Could you show me your vimrc and :CocConfig please?

@pbnj
Copy link

pbnj commented Aug 25, 2020

Here is my coc-related vimrc.
Here is my coc-settings.json.

@esn89
Copy link
Author

esn89 commented Aug 25, 2020

@pbnj Thank you, I will try to tinker around and make it work.

@esn89
Copy link
Author

esn89 commented Aug 25, 2020

Still no luck, do you mind letting me know your nvim version and yaml-language-server version?

@pbnj
Copy link

pbnj commented Aug 26, 2020

I'm on vim

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 20 2020 22:55:15)
macOS version
Included patches: 1-1500
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
-clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua               +ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.15 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin -lpython3.8 -framework CoreFoundation  -lruby.2.7     

And on coc-yaml: - ✓ coc-yaml Current version 1.0.5 is up to date. which ships with yaml-language-server version 0.10.0

@esn89
Copy link
Author

esn89 commented Sep 12, 2020

Nevermind, I found the error, it was my fault.

I was experimenting with ale and had this in my coc-settings.json:
"diagnostic.displayByAle": true,

I deleted it and it works.

@esn89 esn89 closed this as completed Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants