1
1
; ;; lsp-haskell.el --- Haskell support for lsp-mode -*- lexical-binding : t ; -*-
2
2
3
3
; ; Version: 1.1
4
- ; ; Package-Requires: ((emacs "27.1") (lsp-mode "3.0") (haskell-mode "16.1") )
4
+ ; ; Package-Requires: ((emacs "27.1") (lsp-mode "3.0"))
5
5
; ; Keywords: haskell
6
6
; ; URL: https://github.com/emacs-lsp/lsp-haskell
7
7
29
29
; ;; Code:
30
30
31
31
(require 'lsp-mode )
32
- (require 'haskell-mode )
33
32
34
33
; ; ---------------------------------------------------------------------
35
34
; ; Configuration
@@ -467,11 +466,11 @@ but will take exponentially more time."
467
466
" method"
468
467
" LSP semantic token type to use for typeclass methods"
469
468
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
470
- (const " interface" ) (const " struct" ) (const " typeParameter" )
471
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
472
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
473
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
474
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
469
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
470
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
471
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
472
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
473
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
475
474
:group 'lsp-haskell-plugins
476
475
:package-version '(lsp-mode . " 9.0.0" )
477
476
:lsp-path " haskell.plugin.semanticTokens.config.classMethodToken" )
@@ -480,11 +479,11 @@ but will take exponentially more time."
480
479
" class"
481
480
" LSP semantic token type to use for typeclasses"
482
481
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
483
- (const " interface" ) (const " struct" ) (const " typeParameter" )
484
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
485
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
486
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
487
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
482
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
483
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
484
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
485
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
486
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
488
487
:group 'lsp-haskell-plugins
489
488
:package-version '(lsp-mode . " 9.0.0" )
490
489
:lsp-path " haskell.plugin.semanticTokens.config.classToken" )
@@ -493,11 +492,11 @@ but will take exponentially more time."
493
492
" enumMember"
494
493
" LSP semantic token type to use for data constructors"
495
494
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
496
- (const " interface" ) (const " struct" ) (const " typeParameter" )
497
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
498
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
499
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
500
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
495
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
496
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
497
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
498
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
499
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
501
500
:group 'lsp-haskell-plugins
502
501
:package-version '(lsp-mode . " 9.0.0" )
503
502
:lsp-path " haskell.plugin.semanticTokens.config.dataConstructorToken" )
@@ -506,11 +505,11 @@ but will take exponentially more time."
506
505
" function"
507
506
" LSP semantic token type to use for functions"
508
507
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
509
- (const " interface" ) (const " struct" ) (const " typeParameter" )
510
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
511
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
512
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
513
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
508
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
509
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
510
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
511
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
512
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
514
513
:group 'lsp-haskell-plugins
515
514
:package-version '(lsp-mode . " 9.0.0" )
516
515
:lsp-path " haskell.plugin.semanticTokens.config.functionToken" )
@@ -519,11 +518,11 @@ but will take exponentially more time."
519
518
" namespace"
520
519
" LSP semantic token type to use for modules"
521
520
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
522
- (const " interface" ) (const " struct" ) (const " typeParameter" )
523
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
524
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
525
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
526
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
521
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
522
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
523
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
524
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
525
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
527
526
:group 'lsp-haskell-plugins
528
527
:package-version '(lsp-mode . " 9.0.0" )
529
528
:lsp-path " haskell.plugin.semanticTokens.config.moduleToken" )
@@ -532,11 +531,11 @@ but will take exponentially more time."
532
531
" operator"
533
532
" LSP semantic token type to use for operators"
534
533
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
535
- (const " interface" ) (const " struct" ) (const " typeParameter" )
536
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
537
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
538
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
539
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
534
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
535
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
536
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
537
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
538
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
540
539
:group 'lsp-haskell-plugins
541
540
:package-version '(lsp-mode . " 9.0.0" )
542
541
:lsp-path " haskell.plugin.semanticTokens.config.operatorToken" )
@@ -545,11 +544,11 @@ but will take exponentially more time."
545
544
" macro"
546
545
" LSP semantic token type to use for pattern synonyms"
547
546
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
548
- (const " interface" ) (const " struct" ) (const " typeParameter" )
549
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
550
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
551
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
552
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
547
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
548
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
549
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
550
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
551
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
553
552
:group 'lsp-haskell-plugins
554
553
:package-version '(lsp-mode . " 9.0.0" )
555
554
:lsp-path " haskell.plugin.semanticTokens.config.patternSynonymToken" )
@@ -558,11 +557,11 @@ but will take exponentially more time."
558
557
" property"
559
558
" LSP semantic token type to use for record fields"
560
559
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
561
- (const " interface" ) (const " struct" ) (const " typeParameter" )
562
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
563
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
564
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
565
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
560
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
561
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
562
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
563
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
564
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
566
565
:group 'lsp-haskell-plugins
567
566
:package-version '(lsp-mode . " 9.0.0" )
568
567
:lsp-path " haskell.plugin.semanticTokens.config.recordFieldToken" )
@@ -571,11 +570,11 @@ but will take exponentially more time."
571
570
" enum"
572
571
" LSP semantic token type to use for type constructors"
573
572
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
574
- (const " interface" ) (const " struct" ) (const " typeParameter" )
575
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
576
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
577
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
578
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
573
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
574
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
575
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
576
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
577
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
579
578
:group 'lsp-haskell-plugins
580
579
:package-version '(lsp-mode . " 9.0.0" )
581
580
:lsp-path " haskell.plugin.semanticTokens.config.typeConstructorToken" )
@@ -584,11 +583,11 @@ but will take exponentially more time."
584
583
" interface"
585
584
" LSP semantic token type to use for type families"
586
585
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
587
- (const " interface" ) (const " struct" ) (const " typeParameter" )
588
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
589
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
590
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
591
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
586
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
587
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
588
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
589
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
590
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
592
591
:group 'lsp-haskell-plugins
593
592
:package-version '(lsp-mode . " 9.0.0" )
594
593
:lsp-path " haskell.plugin.semanticTokens.config.typeFamilyToken" )
@@ -597,11 +596,11 @@ but will take exponentially more time."
597
596
" type"
598
597
" LSP semantic token type to use for type synonyms"
599
598
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
600
- (const " interface" ) (const " struct" ) (const " typeParameter" )
601
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
602
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
603
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
604
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
599
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
600
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
601
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
602
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
603
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
605
604
:group 'lsp-haskell-plugins
606
605
:package-version '(lsp-mode . " 9.0.0" )
607
606
:lsp-path " haskell.plugin.semanticTokens.config.typeSynonymToken" )
@@ -610,11 +609,11 @@ but will take exponentially more time."
610
609
" typeParameter"
611
610
" LSP semantic token type to use for type variables"
612
611
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
613
- (const " interface" ) (const " struct" ) (const " typeParameter" )
614
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
615
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
616
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
617
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
612
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
613
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
614
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
615
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
616
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
618
617
:group 'lsp-haskell-plugins
619
618
:package-version '(lsp-mode . " 9.0.0" )
620
619
:lsp-path " haskell.plugin.semanticTokens.config.typeVariableToken" )
@@ -623,11 +622,11 @@ but will take exponentially more time."
623
622
" variable"
624
623
" LSP semantic token type to use for variables"
625
624
:type '(choice (const " namespace" ) (const " type" ) (const " class" ) (const " enum" )
626
- (const " interface" ) (const " struct" ) (const " typeParameter" )
627
- (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
628
- (const " event" ) (const " function" ) (const " method" ) (const " macro" )
629
- (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
630
- (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
625
+ (const " interface" ) (const " struct" ) (const " typeParameter" )
626
+ (const " parameter" ) (const " variable" ) (const " property" ) (const " enumMember" )
627
+ (const " event" ) (const " function" ) (const " method" ) (const " macro" )
628
+ (const " keyword" ) (const " modifier" ) (const " comment" ) (const " string" )
629
+ (const " number" ) (const " regexp" ) (const " operator" ) (const " decorator" ))
631
630
:group 'lsp-haskell-plugins
632
631
:package-version '(lsp-mode . " 9.0.0" )
633
632
:lsp-path " haskell.plugin.semanticTokens.config.variableToken" )
@@ -718,19 +717,19 @@ arguments are non-nullable booleans."
718
717
719
718
; ; Register the client itself
720
719
(lsp-register-client
721
- (make-lsp--client
722
- :new-connection (lsp-stdio-connection (lambda () (lsp-haskell--server-command)))
723
- ; ; Should run under haskell-mode, haskell-literate-mode and haskell-tng-mode. We need to list haskell-literate-mode even though it's a derived mode of haskell-mode.
724
- :major-modes '(haskell-mode haskell-literate-mode haskell-tng-mode haskell-cabal-mode haskell-ts-mode)
725
- ; ; This is arbitrary.
726
- :server-id 'lsp-haskell
727
- :synchronize-sections '(" haskell" )
728
- ; ; This is somewhat irrelevant, but it is listed in lsp-language-id-configuration, so
729
- ; ; we should set something consistent here.
730
- :language-id " haskell"
731
- :completion-in-comments? lsp-haskell-completion-in-comments
732
- :action-filter #'lsp-haskell--action-filter
733
- ))
720
+ (make-lsp--client
721
+ :new-connection (lsp-stdio-connection (lambda () (lsp-haskell--server-command)))
722
+ ; ; Should run under haskell-mode, haskell-literate-mode and haskell-tng-mode. We need to list haskell-literate-mode even though it's a derived mode of haskell-mode.
723
+ :major-modes '(haskell-mode haskell-literate-mode haskell-tng-mode haskell-cabal-mode haskell-ts-mode)
724
+ ; ; This is arbitrary.
725
+ :server-id 'lsp-haskell
726
+ :synchronize-sections '(" haskell" )
727
+ ; ; This is somewhat irrelevant, but it is listed in lsp-language-id-configuration, so
728
+ ; ; we should set something consistent here.
729
+ :language-id " haskell"
730
+ :completion-in-comments? lsp-haskell-completion-in-comments
731
+ :action-filter #'lsp-haskell--action-filter
732
+ ))
734
733
735
734
; ; ---------------------------------------------------------------------
736
735
0 commit comments