pantharshit00 / coc-prisma Goto Github PK
View Code? Open in Web Editor NEWCoC extension that implements the Prisma language server
License: MIT License
CoC extension that implements the Prisma language server
License: MIT License
Right now extension does not expose a formatting command. It should implement that
Thanks for your work on this repo. It's made my introduction to prisma much smoother. Though recently it stopped working. I believe I've found the root of the issue.
The following error began popping up upon opening a .prisma
file:
[coc.nvim] The "prisma" server crashed 4 times in the last 3 minutes. The server will not be restarted.
Inspecting CocCommand workspace.showOutput
, we see
[Info - 1:28:19 PM] Default version of Prisma binary 'prisma-fmt': e421996c87d5f3c8f7eeadd502d4ad402c89464d
[Info - 1:28:19 PM] Extension name @prisma/language-server with version 2.21.2
[Info - 1:28:19 PM] Prisma CLI version: 2.21.2
/home/khalliday/.vim/plugged/coc-prisma/node_modules/@prisma/language-server/dist/src/server.js:173
const prismaFmtBinPath = getPrismaFmtBinPath(settings.prismaFmtBinPath);
^
TypeError: Cannot read property 'prismaFmtBinPath' of null
at /home/khalliday/.vim/plugged/coc-prisma/node_modules/@prisma/language-server/dist/src/server.js:173:67
at Generator.next (<anonymous>)
at fulfilled (/home/khalliday/.vim/plugged/coc-prisma/node_modules/@prisma/language-server/dist/src/server.js:24:58)
[Info - 1:28:19 PM] Connection to server got closed. Server will restart.
I believe this issue arises when @prisma/language-server
attempts to get the workspace config settings here.
It seems the workspace configuration section
is now prisma
, not prismaLanguageServer
(as it was in previous versions).
Changing my coc configuration from
"prismaLanguageServer.prismaFmtBinPath": "",
to
"prisma.prismaFmtBinPath": "",
You might consider updating the coc prismaFmtBinPath configuration key in your next release.
I will also note that the issue persists if you do not provide a "prisma.prismaFmtBinPath"
in your coc-settings.json
. Think it would be nice if you did not have to set it to the empty string to force a fallback to the default prisma-fmt
path, and instead just omit the config option.
I've followed the instructions here:
However, when using the command :Format
I get the following: E492: Not an editor command: Format
Also, here is what I have in my coc-settings:
...
"coc.preferences.formatOnSaveFiletypes": [
"css",
"html",
"javascript",
"javascriptreact",
"json",
"jsonc",
"markdown",
"prisma",
"ruby",
"scss",
"typescript",
"typescriptreact",
"yaml"
],
...
But it does not work for prisma. All other filetypes do format properly.
Any ideas?
I have a problem w/ the server crashing randomly. It will crash on startup most of the time but not always. It will also randomly crash on use. When restarting the server using CocCommand the issue will reoccur and I have to repeat the command several times in a row until it works.
This issue occurs regardless of the schema including blank schemas.
os:
Ubuntu 20.04.3 LTS
kernel:
Linux Blackbox 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
node: 16.13.0
~.config/nvim/init.vim
syntax on
set ruler
set showcmd
set showmode
set history=20
set incsearch
set browsedir=buffer
set cmdheight=2
set confirm
set hidden
set background=dark
set autoread
set noallowrevins
set smartindent
set expandtab
set shiftwidth=2
set tabstop=2
set linebreak
set number
set fileformat=unix
set nobomb
let g:coc_force_debug=1
call plug#begin(stdpath('data').'/plugged')
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'cocopon/iceberg.vim'
Plug 'bling/vim-bufferline'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-scripts/Rainbow-Parenthesis'
Plug 'ryanoasis/vim-devicons'
Plug 'tpope/vim-fugitive'
Plug 'pantharshit00/vim-prisma'
call plug#end()
colorscheme iceberg
let g:arline_theme='deus'
augroup nerdtree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') | execute 'NERDTree
' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
augroup END
augroup filetypedetect
autocmd BufNewFile,BufRead *.cjs setf javascript
autocmd BufNewFile,BufRead *.mts setf typescript
autocmd BufNewFile,BufRead *.cts setf typescript
augroup END
let g:coc_filetype_map={'cjs':'javascript', 'mts': 'typescript', 'cts': 'typescript'}
~/.config/nvim/coc-settings.json
{
"tsserver.enable": true,
"tsserver.npm": "/usr/bin/pnpm",
"typescript.preferences.quoteStyle": "single",
"eslint.enable": true,
"eslint.packageManager": "pnpm",
"prisma.prismaFmtBinPath": ""
}
I'm new to coc and vim in general, I was hoping you could help me out. I've tried running :CocInstall coc-prisma
, the installation works but when I try listing my services, prisma doesn't show up. Autocomplete and formatting are also not working.
I have this specified in my init.vim file.
let g:coc_global_extensions = ['coc-eslint', 'coc-json', 'coc-pairs', 'coc-prettier', 'coc-tailwindcss', 'coc-tsserver', 'coc-emmet', 'coc-prisma']
But, I don't seem to get any validation or autocompletion?
Neovim version: v0.5.0
coc-prisma version: v0.10.0
after opening .prima file a message pops server crashes n extension stops working
like can I use graphql with some kind of config file and make it work?
Prisma is starting to support mongoDb. But latest version at the time of writing (v0.9.0) is throwing an error when i add mongoDb
to previewFeatures
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.