purescript-emacs / psc-ide-emacs Goto Github PK
View Code? Open in Web Editor NEWEmacs integration for PureScript's psc-ide tool.
License: GNU General Public License v3.0
Emacs integration for PureScript's psc-ide tool.
License: GNU General Public License v3.0
The flycheck support work great, however all warnings show up as errors (and errors as errors :) )
We're not using the client binary anymore. Found in dysinger/purescript-mode#8.
Using auto-completion anywhere in a file reorders the import list (specifically this happens the moment you hit tab). This is my biggest issue with psc-ide-emacs right now, everything else is working great.
Emacs: 25.2.1
Spacemacs: 0.200.9
C-c C-s
asks me to specify the project root. What should I enter for pulp projects? src/
or the parent of that?
Starting the server seems to star the server for me but Emacs doesn't seem to think it's running.
What's the relationship between psc-ide-emacs and pulp? I didn't see a mention of it in the README.
Thanks!
Loading fails with
Symbol's value as variable is void: purescript-mode-map
I installed fresh package from melpa, followed instructions from README
#31 <- Context
Currently if the psc-ide
utility exists with non-zero code, the psc-ide-send
function doesn't even care about it. Just returns stderr without any error indication.
While enabling purescript-decl-scan-mode
makes imenu queries possible, the solution isn't very robust as it depends on a bunch of regexps. A better solution would be querying psc-ide
for a list of declarations in the current buffer.
cc: @kritzcreek
Related discussion:
syl20bnr/spacemacs#9648
Hi there!
company mode does not seem to work and also flycheck support does not work. I get no errors also nothing in Messages. Any tip on how to do debugging with emacs greatly appreciated :-)
Since psc-ide-npm-bin-server-executable
find purs
instead of purs.cmd
,
file-executable-p
returns nil
.
Could you please fix this?
Hey, I just created a new organisation to collect some of the projects around PureScript in Emacs I'm maintaining. This way we can make sure the ball keeps on rolling if I take a vacation ๐
Would you be up for moving the repository? I'd of course invite you to the organisation if you're still interested in PureScript in Emacs!
When editing two files in the same project, it seems that changes done in one file are not visible to the checker until reloading all modules. More precisely:
Foo.purs
; no errors from FlycheckBar.purs
, try to use whatever was added in Foo
I think by having Flycheck check Foo
, the psc-ide
server should have the changes loaded with the additions to Foo
, and they should be available for Bar
- or is that not the case?
Hey everyone,
I was trying to have my emacs config to run psc-ide-server-start for me.
So I added:
(psc-ide-server-start (psc-ide-suggest-project-dir))
And something to start flycheck-mode.
But on startup, I get spurious messages, it seems possibly while the server is loading the files.
This might be mitigated if there was a way to make flycheck-mode only activate after the server is done starting?
Could you please specify the license used for this package?
Assuming that you want to release under "the GPL v3 or any later version", the best way to do that would be to add this permission statement to the library header:
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
Also consider adding a LICENSE
file containing the text of the GPL-3. You could add just that file without also adding the above persmission statement, but if you do that, then the "or (at your option) any later version" bit won't be known. So I recommend that you add both the actual license and the permission statement.
If you find the permission statement to be too noisy, then you could instead add one of these following lines to the header. If you do that, then it becomes more important to also add the LICENSE
file - a judge might decide that such a line by itself is not sufficient. Still, adding just such a line is better than not specifing the license at all.
;; License: GNU General Public License version 3, or (at your option) any later version
;; License: GNU General Public License version 3, or any later version
;; License: GNU GPL version 3, or (at your option) any later version
;; License: GPL version 3, or (at your option) any later version
;; License: GPL version 3, or any later version
;; License: GPL v3, or (at your option) any later version
;; License: GPL v3, or any later version
;; License: GPL-3+
We also added a bunch of features since I last updated the README.
Things I/we should document
.dir-locals.el
file for easy copy-paste.projectile
file trick to get the correct project rootAfter starting the server with psc-ide-server-start
and getting a confirmation that all modules are loaded, I get the following error when I modify and save a random file:
error in process sentinel: Wrong type argument: flycheck-error-p, [cl-struct-flycheck-error #<buffer xxx.purs> psc-ide "/Users/.../xxx.purs" 353 10 " Unknown data constructor SomeDataCstr
" error #("UnknownName" 0 1 (:suggestion nil :startLine 353 :startColumn 10 :endLine 353 :endColumn 23))]
It seems that the psc-ide-server
correctly reports the Purescript error, but psc-ide
can't really parse it?
So I'm just setting up a brand new Emacs installation, I don't really know what I'm doing, and I got an error while trying to install this package, so I thought I'd open an issue in case it's something that wants addressing in the README here. I'm using emacs 24.5.1, and this is the entire contents of my ~/.emacs.d/init.el
:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
I saw this when I ran package-install RET psc-ide RET
:
Compiling file /home/harry/.emacs.d/elpa/psc-ide-20161220.553/psc-ide-flycheck.el at Thu Jan 12 17:32:41 2017
psc-ide-flycheck.el:20:13:Error: Cannot open load file: no such file or directory, let-alist
Presumably this means that completion won't work? Do I need to install let-alist first?
When I try to go to the definition using M-.
, the wrong file is opened, e.g. when editing src/Module1.purs
and going to a definition which is in src/Module2.purs
, the file src/src/Module2.purs
is opened instead of src/Module2.purs
.
I narrowed this down to the fact that psc-ide-goto-definition-impl
does (expand-file-name file)
on whatever is returned from psc-ide-server
. The expand-file-name
function does the expansion relative to the default-directory
, which, when src/Module1.purs
is opened, is the src
directory.
As psc-ide-server
returns src/Module2.purs
(relative to project root), this path is resolved relatively to src
and hence the src
is duplicated.
Any ideas how to fix this? This used to work ~4 months ago, not sure what changed since :)
It would be nice if psc-ide-emacs could find the root of the current Project and start psc-ide-server
accordingly.
The -d/--directory
switch can be used to set the working directory when starting the server.
I wasn't sure if this should be reported here or in the purescript/purescript repo, so I can move this if it's in the wrong place.
The command to get the type of the identifier under the cursor seems to not work if it is a qualified identifier and the cursor is on the dot between the module name and the identifier name. For example:
When starting the server, after choosing the base directory, I always get invalid argument src/**/*.purs
. This happens when I use the psc-ide-server tool from the console as well. Even when I specify a file that's definitely there. The help for psc-ide-server says
Usage: psc-ide-server [--version] [-d|--directory ARG] [--output-directory ARG]
[-p|--port ARG] [--no-watch] [--debug]
So I'm not sure the tool even accepts files as arguments. I'm using version 0.9.1.
psc 0.7.6.1
psc-ide 0.5
psc-ide-show-type error
psc-ide-unwrap-result: Wrong type argument: listp, "d:"
company
Company: An error occurred in auto-begin
Company: backend company-psc-ide-backend error "Wrong type argument: listp, "d:"" with args (candidates ma)
Any way to fix it?
psc-ide-use-npm-bin
, can't find executablepsc-ide-load-all
returns It seems that server is not running
0.10.x npm bin doesn't work too.
eg: with the following import import qualified Data.Array as A
If the user types:
A.
Lookup completions for Data.Array only.
A thing to take care of is that the following is a valid usecase:
import qualified Html.Dom as DOM
import qualified Html.Dom.Attributes as DOM
So we need to take multiple Modules with the same qualifier into account.
Backend now reports loaded modules as a list of strings instead of a comma-separated string, as mentioned by Herr @kritzcreek in kritzcreek/psc-ide#79 (comment).
Should be easy enough to do with regexes.
See also: https://github.com/nwolverson/atom-ide-purescript/blob/master/lib/editors.coffee#L31
Normally flycheck checks the buffer also e.g. after a new line is added (see http://www.flycheck.org/en/latest/user/syntax-checks.html#check-automatically). However, this doesn't work here. I guess it's because only a rebuild
command is issued to psc-ide
, which then reads the file state from disk. So if the file is not saved, the changes are not visible.
I'm not sure if it's not really a psc-ide
feature request, though?
eg. ghc-company has these contexts:
https://github.com/iquiw/company-ghc/blob/master/company-ghc.el#L150-L174
From the top of my head I can think about these possible contexts:
Apparently company's meta
stopped working for me, is anyone else seeing this?
Im getting the following error when opening a new .purs file:
error in process sentinel: Wrong number of arguments: (2 . 2), 3 [2 times]
and psc-ide-mode
doesn't work (no completions, no flycheck, etc.)
I have this
(add-hook 'purescript-mode-hook
(lambda ()
(psc-ide-mode)
(company-mode)
(flycheck-mode)
(turn-on-purescript-indentation)))
in my init.el
file, but it doesn't seem to help.
Any guess what might be wrong?
Im using emacs 24.5.1 and my OS is OSX El Capitan.
Quoted from syl20bnr/spacemacs#6400 (comment):
It seems that psc-ide-flycheck-insert-suggestion (,-m-i-s) is not setting the type above the value. The value is removed by its type instead. Please check line 7 of following example:
I can't add any of the lens infix operators that start with a %
to my imports using C-c TAB
. For example, .~
and .=
work, but %~
and %=
don't.
Using purescript 0.10.5 and psc-ide-emacs 20161220.553 via melpa.
It looks out of place. Should it be really a part of the package?
On completing identifiers not in scope.
In order to be more consistent I renamed the psc-ide exectuable into psc-ide-client. This will take effect with the purescript-0.8.1 release.
When the completing function ends up modifying the import list, I am left at the import statement with no way to get back to last position.
Hello,
I am quite new to emacs and don't really comprehend what is going on under the hood.
I installed purescript-mode and psc-ide, added
;; PureScript mode
(require 'purescript-mode)
(require 'psc-ide)
(add-hook 'purescript-mode-hook
(lambda ()
(psc-ide-mode)
(company-mode)
(flycheck-mode)))
to my .emacs file and things seem to be working. However, everytime I press Enter / Start a new line I get a popup:
purescript-mode-hook is a variable defined in `purescript-mode.el'.
Its value is ((lambda nil
(psc-ide-mode)
(company-mode)
(flycheck-mode)))
Original value was nil
This variable may be risky if used as a file-local variable.
Documentation:
Hook run after entering PureScript mode.
No problems result if this variable is not bound.
`add-hook' automatically binds it. (This is true for all hook variables.)
You can customize this variable.
[back]
I started the server with C-C C-s and things like C-C C-a work!
Why is this happening? How can I fix it? Thanks!
There are micro freezes when you are typing and company is trying to create complete list. Is it possible to use psc-ide asynchronous?
Also, there should be option to disable pcs-ide company backend, so you could use company with TAGS file.
It seems like purs ide returns source paths as relative to the project directory, rather than absolute like it did in 0.10.
I noticed that go to definition stops working after a source file is edited.
Only after doing a pulp build
followed by a psc-ide-load-all
, the positions are updated and the goto works properly.
The easiest way to reproduce is to introduce two values:
x = 10
y = x
and try to jump to x
from the definition of y
.
Is there some configuration that I might be missing?
It would be nice to have the option to use the ide-server version that's installed in the npm bin
folder (for example, ./node_modules/.bin/psc-ide-server
). This would make it more convenient to use the psc-ide-emacs in multiple projects hat have different versions of the purescript dependency.
I just noticed the ide-purescript Atom package also has this feature.
I constantly get let*: Args out of range: [], 0
when trying to show type for anything.
Standalone psc-ide is deprecated, it's now bundled with purs as purs ide server
.
I upgraded Spacemacs and some packages and started getting this error when trying to show types:
error in process sentinel: Symbol's function definition is void: font-lock-ensure
I'm using psc-ide 20171122.347 and Spacemacs 0.200.10.x
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.