From 2ff45ba94c99acb391e6c5198b7013d4b99bafb1 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 17 Jan 2024 17:09:59 +0000 Subject: [PATCH 01/39] Reorganize flags --- haskell-language-server.cabal | 378 ++++++++++++++++++++++------------ 1 file changed, 244 insertions(+), 134 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 53f0e182cc..b90969d173 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -22,6 +22,10 @@ extra-source-files: test/testdata/**/*.cabal test/testdata/**/*.yaml test/testdata/**/*.hs + + plugins/**/test/testdata/*.hs + plugins/**/test/testdata/*.yaml + bindist/wrapper.in flag pedantic @@ -63,144 +67,15 @@ flag ignore-plugins-ghc-bounds default: False manual: True - -flag cabal - description: Enable cabal plugin - default: True - manual: True - -flag class - description: Enable class plugin - default: True - manual: True - -flag callHierarchy - description: Enable call hierarchy plugin - default: True - manual: True - -flag eval - description: Enable eval plugin - default: True - manual: True - -flag importLens - description: Enable importLens plugin - default: True - manual: True - -flag rename - description: Enable rename plugin - default: True - manual: True - -flag retrie - description: Enable retrie plugin - default: True - manual: True - -flag hlint - description: Enable hlint plugin - default: True - manual: True - -flag stan - description: Enable stan plugin - default: True - manual: True - -flag moduleName - description: Enable moduleName plugin - default: True - manual: True - -flag pragmas - description: Enable pragmas plugin - default: True - manual: True - -flag splice - description: Enable splice plugin - default: True - manual: True - -flag alternateNumberFormat - description: Enable Alternate Number Format plugin - default: True - manual: True - -flag qualifyImportedNames - description: Enable qualifyImportedNames plugin - default: True - manual: True - -flag codeRange - description: Enable Code Range plugin - default: True - manual: True - -flag changeTypeSignature - description: Enable changeTypeSignature plugin - default: True - manual: True - -flag gadt - description: Enable gadt plugin - default: True - manual: True - -flag explicitFixity - description: Enable explicitFixity plugin - default: True - manual: True - -flag explicitFields - description: Enable explicitFields plugin - default: True - manual: True - -flag overloadedRecordDot - description: Enable overloadedRecordDot plugin - default: True - manual: True - -flag semanticTokens - description: Enable semantic tokens plugin - default: True - manual: True - --- formatters - -flag floskell - description: Enable floskell plugin - default: True - manual: True - -flag fourmolu - description: Enable fourmolu plugin - default: True - manual: True - -flag ormolu - description: Enable ormolu plugin - default: True - manual: True - -flag stylishHaskell - description: Enable stylishHaskell plugin - default: True - manual: True - -flag refactor - description: Enable refactor plugin - default: True - manual: True - flag dynamic description: Build with the dyn rts default: True manual: True +----------------------------- +-- cabal-fmt plugin +----------------------------- + flag cabalfmt description: Enable cabal-fmt plugin default: True @@ -211,138 +86,373 @@ common cabalfmt build-depends: hls-cabal-fmt-plugin == 2.6.0.0 cpp-options: -Dhls_cabalfmt +----------------------------- +-- cabal plugin +----------------------------- + +flag cabal + description: Enable cabal plugin + default: True + manual: True + common cabal if flag(cabal) build-depends: hls-cabal-plugin == 2.6.0.0 cpp-options: -Dhls_cabal +----------------------------- +-- class plugin +----------------------------- + +flag class + description: Enable class plugin + default: True + manual: True + common class if flag(class) build-depends: hls-class-plugin == 2.6.0.0 cpp-options: -Dhls_class +----------------------------- +-- call-hierarchy plugin +----------------------------- + +flag callHierarchy + description: Enable call hierarchy plugin + default: True + manual: True + common callHierarchy if flag(callHierarchy) build-depends: hls-call-hierarchy-plugin == 2.6.0.0 cpp-options: -Dhls_callHierarchy +----------------------------- +-- eval plugin +----------------------------- + +flag eval + description: Enable eval plugin + default: True + manual: True + common eval if flag(eval) build-depends: hls-eval-plugin == 2.6.0.0 cpp-options: -Dhls_eval +----------------------------- +-- import lens plugin +----------------------------- + common importLens if flag(importLens) build-depends: hls-explicit-imports-plugin == 2.6.0.0 cpp-options: -Dhls_importLens +flag importLens + description: Enable importLens plugin + default: True + manual: True + +----------------------------- +-- rename plugin +----------------------------- + +flag rename + description: Enable rename plugin + default: True + manual: True + common rename if flag(rename) build-depends: hls-rename-plugin == 2.6.0.0 cpp-options: -Dhls_rename +----------------------------- +-- retrie plugin +----------------------------- + +flag retrie + description: Enable retrie plugin + default: True + manual: True + common retrie if flag(retrie) build-depends: hls-retrie-plugin == 2.6.0.0 cpp-options: -Dhls_retrie +----------------------------- +-- hlint plugin +----------------------------- + +flag hlint + description: Enable hlint plugin + default: True + manual: True + common hlint if flag(hlint) && (impl(ghc < 9.8.0) || flag(ignore-plugins-ghc-bounds)) build-depends: hls-hlint-plugin == 2.6.0.0 cpp-options: -Dhls_hlint +----------------------------- +-- stan plugin +----------------------------- + +flag stan + description: Enable stan plugin + default: True + manual: True + common stan if flag(stan) && (impl(ghc > 8.8.1) && impl(ghc <= 9.2.3) || impl(ghc >= 9.4.0) && impl(ghc < 9.10.0)) build-depends: hls-stan-plugin == 2.6.0.0 cpp-options: -Dhls_stan +----------------------------- +-- module name plugin +----------------------------- + +flag moduleName + description: Enable moduleName plugin + default: True + manual: True + common moduleName if flag(moduleName) build-depends: hls-module-name-plugin == 2.6.0.0 cpp-options: -Dhls_moduleName +----------------------------- +-- pragmas plugin +----------------------------- + +flag pragmas + description: Enable pragmas plugin + default: True + manual: True + common pragmas if flag(pragmas) build-depends: hls-pragmas-plugin == 2.6.0.0 cpp-options: -Dhls_pragmas +----------------------------- +-- splice plugin +----------------------------- + +flag splice + description: Enable splice plugin + default: True + manual: True + common splice if flag(splice) build-depends: hls-splice-plugin == 2.6.0.0 cpp-options: -Dhls_splice +----------------------------- +-- alternate number format plugin +----------------------------- + +flag alternateNumberFormat + description: Enable Alternate Number Format plugin + default: True + manual: True + common alternateNumberFormat if flag(alternateNumberFormat) build-depends: hls-alternate-number-format-plugin == 2.6.0.0 cpp-options: -Dhls_alternateNumberFormat +----------------------------- +-- qualify imported names plugin +----------------------------- + +flag qualifyImportedNames + description: Enable qualifyImportedNames plugin + default: True + manual: True + common qualifyImportedNames if flag(qualifyImportedNames) build-depends: hls-qualify-imported-names-plugin == 2.6.0.0 cpp-options: -Dhls_qualifyImportedNames +----------------------------- +-- code range plugin +----------------------------- + +flag codeRange + description: Enable Code Range plugin + default: True + manual: True + common codeRange if flag(codeRange) build-depends: hls-code-range-plugin == 2.6.0.0 cpp-options: -Dhls_codeRange +----------------------------- +-- change type signature plugin +----------------------------- + +flag changeTypeSignature + description: Enable changeTypeSignature plugin + default: True + manual: True + common changeTypeSignature if flag(changeTypeSignature) build-depends: hls-change-type-signature-plugin == 2.6.0.0 cpp-options: -Dhls_changeTypeSignature +----------------------------- +-- gadt plugin +----------------------------- + +flag gadt + description: Enable gadt plugin + default: True + manual: True + common gadt if flag(gadt) build-depends: hls-gadt-plugin == 2.6.0.0 cpp-options: -Dhls_gadt +----------------------------- +-- explicit fixity plugin +----------------------------- + +flag explicitFixity + description: Enable explicitFixity plugin + default: True + manual: True + common explicitFixity if flag(explicitFixity) build-depends: hls-explicit-fixity-plugin == 2.6.0.0 cpp-options: -DexplicitFixity +----------------------------- +-- explicit fields plugin +----------------------------- + +flag explicitFields + description: Enable explicitFields plugin + default: True + manual: True + common explicitFields if flag(explicitFields) build-depends: hls-explicit-record-fields-plugin == 2.6.0.0 cpp-options: -DexplicitFields +----------------------------- +-- overloaded record dot plugin +----------------------------- + +flag overloadedRecordDot + description: Enable overloadedRecordDot plugin + default: True + manual: True + common overloadedRecordDot if flag(overloadedRecordDot) build-depends: hls-overloaded-record-dot-plugin == 2.6.0.0 cpp-options: -Dhls_overloaded_record_dot --- formatters +----------------------------- +-- floskell plugin +----------------------------- + +flag floskell + description: Enable floskell plugin + default: True + manual: True common floskell if flag(floskell) && (impl(ghc < 9.7) || flag(ignore-plugins-ghc-bounds)) build-depends: hls-floskell-plugin == 2.6.0.0 cpp-options: -Dhls_floskell +----------------------------- +-- fourmolu plugin +----------------------------- + +flag fourmolu + description: Enable fourmolu plugin + default: True + manual: True + common fourmolu if flag(fourmolu) build-depends: hls-fourmolu-plugin == 2.6.0.0 cpp-options: -Dhls_fourmolu +----------------------------- +-- ormolu plugin +----------------------------- + +flag ormolu + description: Enable ormolu plugin + default: True + manual: True + common ormolu if flag(ormolu) build-depends: hls-ormolu-plugin == 2.6.0.0 cpp-options: -Dhls_ormolu +----------------------------- +-- stylish-haskell plugin +----------------------------- + +flag stylishHaskell + description: Enable stylishHaskell plugin + default: True + manual: True + common stylishHaskell if flag(stylishHaskell) && (impl(ghc < 9.8.0) || flag(ignore-plugins-ghc-bounds)) build-depends: hls-stylish-haskell-plugin == 2.6.0.0 cpp-options: -Dhls_stylishHaskell +----------------------------- +-- refactor plugin +----------------------------- + +flag refactor + description: Enable refactor plugin + default: True + manual: True + common refactor if flag(refactor) build-depends: hls-refactor-plugin == 2.6.0.0 cpp-options: -Dhls_refactor +----------------------------- +-- semantic tokens plugin +----------------------------- + +flag semanticTokens + description: Enable semantic tokens plugin + default: True + manual: True + common semanticTokens if flag(semanticTokens) build-depends: hls-semantic-tokens-plugin == 2.6.0.0 cpp-options: -Dhls_semanticTokens +----------------------------- +-- HLS +----------------------------- library import: common-deps From 60079beba1d322dd86c57846a15e069a08165eee Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 17 Jan 2024 17:10:40 +0000 Subject: [PATCH 02/39] hls-alternate-number-format-plugin --- cabal.project | 1 - haskell-language-server.cabal | 63 +++++- .../LICENSE | 201 ------------------ .../hls-alternate-number-format-plugin.cabal | 75 ------- .../test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 58 insertions(+), 286 deletions(-) delete mode 100644 plugins/hls-alternate-number-format-plugin/LICENSE delete mode 100644 plugins/hls-alternate-number-format-plugin/hls-alternate-number-format-plugin.cabal diff --git a/cabal.project b/cabal.project index 27235f5b20..127757e8aa 100644 --- a/cabal.project +++ b/cabal.project @@ -24,7 +24,6 @@ packages: ./plugins/hls-module-name-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-alternate-number-format-plugin ./plugins/hls-qualify-imported-names-plugin ./plugins/hls-code-range-plugin ./plugins/hls-change-type-signature-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index b90969d173..ce4e974799 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -28,11 +28,6 @@ extra-source-files: bindist/wrapper.in -flag pedantic - description: Enable -Werror - default: False - manual: True - source-repository head type: git location: https://github.com/haskell/haskell-language-server @@ -50,6 +45,11 @@ common common-deps common warnings ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors +flag pedantic + description: Enable -Werror + default: False + manual: True + -- Allow compiling in pedantic mode common pedantic if flag(pedantic) @@ -265,9 +265,60 @@ flag alternateNumberFormat common alternateNumberFormat if flag(alternateNumberFormat) - build-depends: hls-alternate-number-format-plugin == 2.6.0.0 + build-depends: hls-alternate-number-format-plugin cpp-options: -Dhls_alternateNumberFormat +library hls-alternate-number-format-plugin + import: warnings + exposed-modules: Ide.Plugin.AlternateNumberFormat, Ide.Plugin.Conversion + other-modules: Ide.Plugin.Literals + hs-source-dirs: plugins/hls-alternate-number-format-plugin/src + ghc-options: -Wall + build-depends: + , base >=4.12 && < 5 + , containers + , extra + , ghcide == 2.6.0.0 + , ghc-boot-th + , hls-graph + , hls-plugin-api == 2.6.0.0 + , lens + , lsp ^>=2.3.0.0 + , mtl + , regex-tdfa + , syb + , text + + default-language: Haskell2010 + default-extensions: + LambdaCase + NamedFieldPuns + OverloadedStrings + RecordWildCards + +test-suite hls-alternate-number-format-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-alternate-number-format-plugin/test + other-modules: Properties.Conversion + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts + build-depends: + , base >=4.12 && < 5 + , filepath + , hls-alternate-number-format-plugin + , hls-test-utils == 2.6.0.0 + , regex-tdfa + , tasty-quickcheck + , text + + default-extensions: + LambdaCase + NamedFieldPuns + OverloadedStrings + RecordWildCards + ----------------------------- -- qualify imported names plugin ----------------------------- diff --git a/plugins/hls-alternate-number-format-plugin/LICENSE b/plugins/hls-alternate-number-format-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-alternate-number-format-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-alternate-number-format-plugin/hls-alternate-number-format-plugin.cabal b/plugins/hls-alternate-number-format-plugin/hls-alternate-number-format-plugin.cabal deleted file mode 100644 index 01bbdcb214..0000000000 --- a/plugins/hls-alternate-number-format-plugin/hls-alternate-number-format-plugin.cabal +++ /dev/null @@ -1,75 +0,0 @@ -cabal-version: 2.4 -name: hls-alternate-number-format-plugin -version: 2.6.0.0 -synopsis: Provide Alternate Number Formats plugin for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Nick Suchecki -maintainer: nicksuchecki@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - README.md - test/testdata/*.hs - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.AlternateNumberFormat, Ide.Plugin.Conversion - other-modules: Ide.Plugin.Literals - hs-source-dirs: src - build-depends: - , base >=4.12 && < 5 - , containers - , extra - , ghcide == 2.6.0.0 - , ghc-boot-th - , hls-graph - , hls-plugin-api == 2.6.0.0 - , lens - , lsp ^>=2.3.0.0 - , mtl - , regex-tdfa - , syb - , text - - default-language: Haskell2010 - default-extensions: - LambdaCase - NamedFieldPuns - OverloadedStrings - RecordWildCards - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - other-modules: Properties.Conversion - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts - build-depends: - , base >=4.12 && < 5 - , filepath - , hls-alternate-number-format-plugin - , hls-test-utils == 2.6.0.0 - , regex-tdfa - , tasty-quickcheck - , text - - default-extensions: - LambdaCase - NamedFieldPuns - OverloadedStrings - RecordWildCards diff --git a/plugins/hls-alternate-number-format-plugin/test/Main.hs b/plugins/hls-alternate-number-format-plugin/test/Main.hs index 323a5f0618..a9a6e44e0f 100644 --- a/plugins/hls-alternate-number-format-plugin/test/Main.hs +++ b/plugins/hls-alternate-number-format-plugin/test/Main.hs @@ -70,7 +70,7 @@ findAlternateNumberActions = pure . filter isAlternateNumberCodeAction . rights -- most helpers derived from explicit-imports-plugin Main Test file testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-alternate-number-format-plugin" "test" "testdata" goldenAlternateFormat :: FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree goldenAlternateFormat fp = goldenWithHaskellDoc def alternateNumberFormatPlugin (fp <> " (golden)") testDataDir fp "expected" "hs" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 50823b9d7b..8d89ebf752 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-alternate-number-format-plugin - ./plugins/hls-cabal-fmt-plugin - ./plugins/hls-cabal-plugin - ./plugins/hls-call-hierarchy-plugin diff --git a/stack.yaml b/stack.yaml index 63101b21e9..06215b5d68 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-alternate-number-format-plugin - ./plugins/hls-cabal-fmt-plugin - ./plugins/hls-cabal-plugin - ./plugins/hls-call-hierarchy-plugin From d41cc4b78991a5bf2724304039c0cd2b8bb1e8f5 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 17 Jan 2024 17:23:04 +0000 Subject: [PATCH 03/39] hls-cabal-fmt-plugin --- cabal.project | 1 - haskell-language-server.cabal | 43 ++++- plugins/hls-cabal-fmt-plugin/LICENSE | 201 ---------------------- plugins/hls-cabal-fmt-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 6 files changed, 43 insertions(+), 206 deletions(-) delete mode 100644 plugins/hls-cabal-fmt-plugin/LICENSE diff --git a/cabal.project b/cabal.project index 127757e8aa..576da1c0dc 100644 --- a/cabal.project +++ b/cabal.project @@ -9,7 +9,6 @@ packages: ./hls-plugin-api ./hls-test-utils ./plugins/hls-cabal-plugin - ./plugins/hls-cabal-fmt-plugin ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin ./plugins/hls-class-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index ce4e974799..69dea01319 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -83,9 +83,50 @@ flag cabalfmt common cabalfmt if flag(cabalfmt) - build-depends: hls-cabal-fmt-plugin == 2.6.0.0 + build-depends: hls-cabal-fmt-plugin cpp-options: -Dhls_cabalfmt +flag isolateCabalfmtTests + description: Should tests search for 'cabal-fmt' on the $PATH or shall we install it via build-tool-depends? + -- By default, search on the PATH + default: False + manual: True + +library hls-cabal-fmt-plugin + import: warnings + exposed-modules: Ide.Plugin.CabalFmt + hs-source-dirs: plugins/hls-cabal-fmt-plugin/src + build-depends: + , base >=4.12 && <5 + , directory + , filepath + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lens + , lsp-types + , mtl + , process-extras + , text + + default-language: Haskell2010 + +test-suite hls-cabal-fmt-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-cabal-fmt-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , directory + , filepath + , hls-cabal-fmt-plugin + , hls-test-utils == 2.6.0.0 + + if flag(isolateCabalfmtTests) + build-tool-depends: cabal-fmt:cabal-fmt ^>=0.1.6 + ----------------------------- -- cabal plugin ----------------------------- diff --git a/plugins/hls-cabal-fmt-plugin/LICENSE b/plugins/hls-cabal-fmt-plugin/LICENSE deleted file mode 100644 index 16502c47e2..0000000000 --- a/plugins/hls-cabal-fmt-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 The Haskell IDE team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-cabal-fmt-plugin/test/Main.hs b/plugins/hls-cabal-fmt-plugin/test/Main.hs index d2e0b9c0f1..9ad0498f0f 100644 --- a/plugins/hls-cabal-fmt-plugin/test/Main.hs +++ b/plugins/hls-cabal-fmt-plugin/test/Main.hs @@ -57,4 +57,4 @@ cabalFmtGolden Found title path desc act = goldenWithCabalDocFormatter def cabal conf = def testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-cabal-fmt-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 8d89ebf752..f6338a02d0 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-cabal-fmt-plugin - ./plugins/hls-cabal-plugin - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin diff --git a/stack.yaml b/stack.yaml index 06215b5d68..4aed277350 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-cabal-fmt-plugin - ./plugins/hls-cabal-plugin - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin From 50e762d61389ed9bf20d18c058ba05d2b6a58c00 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:25:12 +0000 Subject: [PATCH 04/39] cabal plugin --- cabal.project | 1 - haskell-language-server.cabal | 69 ++++++++++++++ plugins/hls-cabal-plugin/LICENSE | 20 ---- .../hls-cabal-plugin/hls-cabal-plugin.cabal | 92 ------------------- plugins/hls-cabal-plugin/test/Utils.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 70 insertions(+), 116 deletions(-) delete mode 100644 plugins/hls-cabal-plugin/LICENSE delete mode 100644 plugins/hls-cabal-plugin/hls-cabal-plugin.cabal diff --git a/cabal.project b/cabal.project index 576da1c0dc..b3f861aee7 100644 --- a/cabal.project +++ b/cabal.project @@ -8,7 +8,6 @@ packages: ./ghcide/test ./hls-plugin-api ./hls-test-utils - ./plugins/hls-cabal-plugin ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin ./plugins/hls-class-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 69dea01319..83fe35b559 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -141,6 +141,75 @@ common cabal build-depends: hls-cabal-plugin == 2.6.0.0 cpp-options: -Dhls_cabal +library hls-cabal-plugin + import: warnings + exposed-modules: + Ide.Plugin.Cabal + Ide.Plugin.Cabal.Diagnostics + Ide.Plugin.Cabal.Completion.Completer.FilePath + Ide.Plugin.Cabal.Completion.Completer.Module + Ide.Plugin.Cabal.Completion.Completer.Paths + Ide.Plugin.Cabal.Completion.Completer.Simple + Ide.Plugin.Cabal.Completion.Completer.Snippet + Ide.Plugin.Cabal.Completion.Completer.Types + Ide.Plugin.Cabal.Completion.Completions + Ide.Plugin.Cabal.Completion.Data + Ide.Plugin.Cabal.Completion.Types + Ide.Plugin.Cabal.LicenseSuggest + Ide.Plugin.Cabal.Parse + + + build-depends: + , base >=4.12 && <5 + , bytestring + , Cabal-syntax >= 3.7 + , containers + , deepseq + , directory + , filepath + , extra >=1.7.4 + , ghcide == 2.6.0.0 + , hashable + , hls-plugin-api == 2.6.0.0 + , hls-graph == 2.6.0.0 + , lens + , lsp ^>=2.3 + , lsp-types ^>=2.1 + , regex-tdfa ^>=1.3.1 + , stm + , text + , text-rope + , transformers + , unordered-containers >=0.2.10.0 + , containers + hs-source-dirs: plugins/hls-cabal-plugin/src + default-language: Haskell2010 + +test-suite hls-cabal-plugin-tests + import: warnings + default-language: Haskell2010 + type: exitcode-stdio-1.0 + hs-source-dirs: plugins/hls-cabal-plugin/test + main-is: Main.hs + other-modules: + Completer + Context + Utils + build-depends: + , base + , bytestring + , Cabal-syntax >= 3.7 + , filepath + , hls-cabal-plugin + , hls-test-utils == 2.6.0.0 + , lens + , lsp + , lsp-types + , text + , text-rope + , transformers + , row-types + ----------------------------- -- class plugin ----------------------------- diff --git a/plugins/hls-cabal-plugin/LICENSE b/plugins/hls-cabal-plugin/LICENSE deleted file mode 100644 index 6d34465ea5..0000000000 --- a/plugins/hls-cabal-plugin/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2022 Fendor - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal b/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal deleted file mode 100644 index 4c99507a2c..0000000000 --- a/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal +++ /dev/null @@ -1,92 +0,0 @@ -cabal-version: 3.0 -name: hls-cabal-plugin -version: 2.6.0.0 -synopsis: Cabal integration plugin with Haskell Language Server -description: - Please see the README on GitHub at - -homepage: -license: MIT -license-file: LICENSE -author: Fendor -maintainer: fendor@posteo.de -category: Development -extra-source-files: - CHANGELOG.md - test/testdata/*.cabal - test/testdata/simple-cabal/A.hs - test/testdata/simple-cabal/cabal.project - test/testdata/simple-cabal/hie.yaml - test/testdata/simple-cabal/simple-cabal.cabal - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: - Ide.Plugin.Cabal - Ide.Plugin.Cabal.Diagnostics - Ide.Plugin.Cabal.Completion.Completer.FilePath - Ide.Plugin.Cabal.Completion.Completer.Module - Ide.Plugin.Cabal.Completion.Completer.Paths - Ide.Plugin.Cabal.Completion.Completer.Simple - Ide.Plugin.Cabal.Completion.Completer.Snippet - Ide.Plugin.Cabal.Completion.Completer.Types - Ide.Plugin.Cabal.Completion.Completions - Ide.Plugin.Cabal.Completion.Data - Ide.Plugin.Cabal.Completion.Types - Ide.Plugin.Cabal.LicenseSuggest - Ide.Plugin.Cabal.Parse - - - build-depends: - , base >=4.12 && <5 - , bytestring - , Cabal-syntax >= 3.7 - , containers - , deepseq - , directory - , filepath - , extra >=1.7.4 - , ghcide == 2.6.0.0 - , hashable - , hls-plugin-api == 2.6.0.0 - , hls-graph == 2.6.0.0 - , lens - , lsp ^>=2.3 - , lsp-types ^>=2.1 - , regex-tdfa ^>=1.3.1 - , stm - , text - , text-rope - , transformers - , unordered-containers >=0.2.10.0 - , containers - hs-source-dirs: src - default-language: Haskell2010 - -test-suite tests - import: warnings - default-language: Haskell2010 - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Main.hs - other-modules: - Completer - Context - Utils - build-depends: - , base - , bytestring - , Cabal-syntax >= 3.7 - , filepath - , hls-cabal-plugin - , hls-test-utils == 2.6.0.0 - , lens - , lsp - , lsp-types - , text - , text-rope - , transformers - , row-types diff --git a/plugins/hls-cabal-plugin/test/Utils.hs b/plugins/hls-cabal-plugin/test/Utils.hs index f6df79cc8b..cd83ba623e 100644 --- a/plugins/hls-cabal-plugin/test/Utils.hs +++ b/plugins/hls-cabal-plugin/test/Utils.hs @@ -47,7 +47,7 @@ runCabalSession subdir = failIfSessionTimeout . runSessionWithServer def cabalPlugin (testDataDir subdir) testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-cabal-plugin" "test" "testdata" -- | list comparison where the order in the list is irrelevant (@?==) :: (HasCallStack, Ord a, Show a) => [a] -> [a] -> Assertion diff --git a/stack-lts21.yaml b/stack-lts21.yaml index f6338a02d0..d0fb06e775 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-cabal-plugin - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-class-plugin diff --git a/stack.yaml b/stack.yaml index 4aed277350..38bdf7b650 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-cabal-plugin - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-class-plugin From d4f7a90ecc34aa62290d5a70c2e25ed5b10b6f79 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:30:14 +0000 Subject: [PATCH 05/39] Class plugin --- cabal.project | 1 - haskell-language-server.cabal | 50 +++++ plugins/hls-class-plugin/LICENSE | 201 ------------------ .../hls-class-plugin/hls-class-plugin.cabal | 78 ------- plugins/hls-class-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 51 insertions(+), 283 deletions(-) delete mode 100644 plugins/hls-class-plugin/LICENSE delete mode 100644 plugins/hls-class-plugin/hls-class-plugin.cabal diff --git a/cabal.project b/cabal.project index b3f861aee7..7f9860b490 100644 --- a/cabal.project +++ b/cabal.project @@ -10,7 +10,6 @@ packages: ./hls-test-utils ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin - ./plugins/hls-class-plugin ./plugins/hls-eval-plugin ./plugins/hls-explicit-imports-plugin ./plugins/hls-hlint-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 83fe35b559..087ac6d314 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -224,6 +224,56 @@ common class build-depends: hls-class-plugin == 2.6.0.0 cpp-options: -Dhls_class +library hls-class-plugin + import: warnings + exposed-modules: Ide.Plugin.Class + other-modules: Ide.Plugin.Class.CodeAction + , Ide.Plugin.Class.CodeLens + , Ide.Plugin.Class.ExactPrint + , Ide.Plugin.Class.Types + , Ide.Plugin.Class.Utils + hs-source-dirs: plugins/hls-class-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , deepseq + , extra + , ghc + , ghc-exactprint >= 1.5 + , ghcide == 2.6.0.0 + , hls-graph + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , mtl + , text + , transformers + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + OverloadedStrings + +test-suite hls-class-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-class-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , ghcide + , hls-class-plugin + , hls-test-utils == 2.6.0.0 + , lens + , lsp-types + , row-types + , text + ----------------------------- -- call-hierarchy plugin ----------------------------- diff --git a/plugins/hls-class-plugin/LICENSE b/plugins/hls-class-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-class-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-class-plugin/hls-class-plugin.cabal b/plugins/hls-class-plugin/hls-class-plugin.cabal deleted file mode 100644 index 096d63cae5..0000000000 --- a/plugins/hls-class-plugin/hls-class-plugin.cabal +++ /dev/null @@ -1,78 +0,0 @@ -cabal-version: 2.4 -name: hls-class-plugin -version: 2.6.0.0 -synopsis: - Class/instance management plugin for Haskell Language Server - -description: - Class/instance management plugin for Haskell Language Server. - For usage, please see README of HLS on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Junyoung Clare Jang -maintainer: jjc9310@gmail.com -homepage: https://github.com/haskell/haskell-language-server#readme -bug-reports: https://github.com/haskell/haskell-language-server/issues -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wno-unticked-promoted-constructors -Wno-name-shadowing -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.Class - other-modules: Ide.Plugin.Class.CodeAction - , Ide.Plugin.Class.CodeLens - , Ide.Plugin.Class.ExactPrint - , Ide.Plugin.Class.Types - , Ide.Plugin.Class.Utils - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , deepseq - , extra - , ghc - , ghc-exactprint >= 1.5 - , ghcide == 2.6.0.0 - , hls-graph - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , mtl - , text - , transformers - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - OverloadedStrings - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , ghcide - , hls-class-plugin - , hls-test-utils == 2.6.0.0 - , lens - , lsp-types - , row-types - , text diff --git a/plugins/hls-class-plugin/test/Main.hs b/plugins/hls-class-plugin/test/Main.hs index 7274381544..89f3d03cf9 100644 --- a/plugins/hls-class-plugin/test/Main.hs +++ b/plugins/hls-class-plugin/test/Main.hs @@ -173,4 +173,4 @@ expectCodeActionsAvailable title path actionTitles = expectedActions = Just <$> actionTitles testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-class-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index d0fb06e775..687cee9b2b 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -11,7 +11,6 @@ packages: # - ./shake-bench - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin - - ./plugins/hls-class-plugin - ./plugins/hls-code-range-plugin - ./plugins/hls-eval-plugin - ./plugins/hls-explicit-fixity-plugin diff --git a/stack.yaml b/stack.yaml index 38bdf7b650..8659c3d590 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,7 +11,6 @@ packages: # - ./shake-bench - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin - - ./plugins/hls-class-plugin - ./plugins/hls-code-range-plugin - ./plugins/hls-eval-plugin - ./plugins/hls-explicit-fixity-plugin From f545d29ddf4f179217279c1d4a3c1cbd051f1946 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:33:36 +0000 Subject: [PATCH 06/39] Call hierarchy plugin --- cabal.project | 1 - haskell-language-server.cabal | 47 ++++ plugins/hls-call-hierarchy-plugin/LICENSE | 201 ------------------ .../hls-call-hierarchy-plugin.cabal | 70 ------ .../hls-call-hierarchy-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 48 insertions(+), 275 deletions(-) delete mode 100644 plugins/hls-call-hierarchy-plugin/LICENSE delete mode 100644 plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal diff --git a/cabal.project b/cabal.project index 7f9860b490..01d9eadd60 100644 --- a/cabal.project +++ b/cabal.project @@ -20,7 +20,6 @@ packages: ./plugins/hls-pragmas-plugin ./plugins/hls-module-name-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-call-hierarchy-plugin ./plugins/hls-qualify-imported-names-plugin ./plugins/hls-code-range-plugin ./plugins/hls-change-type-signature-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 087ac6d314..12490e075e 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -288,6 +288,53 @@ common callHierarchy build-depends: hls-call-hierarchy-plugin == 2.6.0.0 cpp-options: -Dhls_callHierarchy +library hls-call-hierarchy-plugin + import: warnings + buildable: True + exposed-modules: Ide.Plugin.CallHierarchy + other-modules: + Ide.Plugin.CallHierarchy.Internal + Ide.Plugin.CallHierarchy.Query + Ide.Plugin.CallHierarchy.Types + + hs-source-dirs: plugins/hls-call-hierarchy-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , extra + , ghcide == 2.6.0.0 + , hiedb + , hls-plugin-api == 2.6.0.0 + , lens + , lsp >=2.3 + , sqlite-simple + , text + + default-language: Haskell2010 + default-extensions: DataKinds + +test-suite hls-call-hierarchy-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-call-hierarchy-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , aeson + , base + , containers + , extra + , filepath + , hls-call-hierarchy-plugin + , hls-test-utils == 2.6.0.0 + , ghcide-test-utils + , lens + , lsp + , lsp-test + , text + ----------------------------- -- eval plugin ----------------------------- diff --git a/plugins/hls-call-hierarchy-plugin/LICENSE b/plugins/hls-call-hierarchy-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-call-hierarchy-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal deleted file mode 100644 index 151e5f020a..0000000000 --- a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal +++ /dev/null @@ -1,70 +0,0 @@ -cabal-version: 2.4 -name: hls-call-hierarchy-plugin -version: 2.6.0.0 -synopsis: Call hierarchy plugin for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Lei Zhu -maintainer: julytreee@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - buildable: True - exposed-modules: Ide.Plugin.CallHierarchy - other-modules: - Ide.Plugin.CallHierarchy.Internal - Ide.Plugin.CallHierarchy.Query - Ide.Plugin.CallHierarchy.Types - - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , extra - , ghcide == 2.6.0.0 - , hiedb - , hls-plugin-api == 2.6.0.0 - , lens - , lsp >=2.3 - , sqlite-simple - , text - - default-language: Haskell2010 - default-extensions: DataKinds - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , aeson - , base - , containers - , extra - , filepath - , hls-call-hierarchy-plugin - , hls-test-utils == 2.6.0.0 - , ghcide-test-utils - , lens - , lsp - , lsp-test - , text diff --git a/plugins/hls-call-hierarchy-plugin/test/Main.hs b/plugins/hls-call-hierarchy-plugin/test/Main.hs index 4e4db53087..ebf29a11f8 100644 --- a/plugins/hls-call-hierarchy-plugin/test/Main.hs +++ b/plugins/hls-call-hierarchy-plugin/test/Main.hs @@ -527,7 +527,7 @@ mkCallHierarchyOutgoingCall :: (CallHierarchyItem, Range) -> CallHierarchyOutgoi mkCallHierarchyOutgoingCall (item, range) = CallHierarchyOutgoingCall item [range] testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-call-hierarchy-plugin" "test" "testdata" mkPrepareCallHierarchyParam :: TextDocumentIdentifier -> Int -> Int -> CallHierarchyPrepareParams mkPrepareCallHierarchyParam doc x y = CallHierarchyPrepareParams doc (Position (fromIntegral x) (fromIntegral y)) Nothing diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 687cee9b2b..7cb8994bdf 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-code-range-plugin - ./plugins/hls-eval-plugin diff --git a/stack.yaml b/stack.yaml index 8659c3d590..5ba3f92a93 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-call-hierarchy-plugin - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-code-range-plugin - ./plugins/hls-eval-plugin From fb37764e1f5b000971f832e0047c409b852f0bc2 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:39:02 +0000 Subject: [PATCH 07/39] Eval plugin --- cabal.project | 1 - haskell-language-server.cabal | 72 +++++++ plugins/hls-eval-plugin/LICENSE | 201 ------------------ plugins/hls-eval-plugin/hls-eval-plugin.cabal | 113 ---------- plugins/hls-eval-plugin/test/Main.hs | 2 +- .../test/testdata/TFlags.ghc98.expected.hs | 64 ++++++ .../testdata/TPropertyError.ghc96.expected.hs | 13 ++ stack-lts21.yaml | 1 - stack.yaml | 1 - 9 files changed, 150 insertions(+), 318 deletions(-) delete mode 100644 plugins/hls-eval-plugin/LICENSE delete mode 100644 plugins/hls-eval-plugin/hls-eval-plugin.cabal create mode 100644 plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs create mode 100644 plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc96.expected.hs diff --git a/cabal.project b/cabal.project index 01d9eadd60..43563a40e1 100644 --- a/cabal.project +++ b/cabal.project @@ -10,7 +10,6 @@ packages: ./hls-test-utils ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin - ./plugins/hls-eval-plugin ./plugins/hls-explicit-imports-plugin ./plugins/hls-hlint-plugin ./plugins/hls-rename-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 12490e075e..7c546ed459 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -349,6 +349,78 @@ common eval build-depends: hls-eval-plugin == 2.6.0.0 cpp-options: -Dhls_eval +library hls-eval-plugin + import: warnings + exposed-modules: + Ide.Plugin.Eval + Ide.Plugin.Eval.Types + + hs-source-dirs: plugins/hls-eval-plugin/src + other-modules: + Ide.Plugin.Eval.Code + Ide.Plugin.Eval.CodeLens + Ide.Plugin.Eval.Config + Ide.Plugin.Eval.GHC + Ide.Plugin.Eval.Parse.Comments + Ide.Plugin.Eval.Parse.Option + Ide.Plugin.Eval.Rules + Ide.Plugin.Eval.Util + + build-depends: + , aeson + , base >=4.12 && <5 + , bytestring + , containers + , deepseq + , Diff ^>=0.4.0 + , dlist + , extra + , filepath + , ghc + , ghc-boot-th + , ghcide == 2.6.0.0 + , hls-graph + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , lsp-types + , megaparsec >=9.0 + , mtl + , parser-combinators >=1.2 + , text + , transformers + , unliftio + , unordered-containers + + if flag(pedantic) + ghc-options: -Werror + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + +test-suite hls-eval-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-eval-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts + build-depends: + , aeson + , base + , containers + , extra + , filepath + , hls-eval-plugin + , hls-plugin-api + , hls-test-utils == 2.6.0.0 + , lens + , lsp-types + , text + , row-types + ----------------------------- -- import lens plugin ----------------------------- diff --git a/plugins/hls-eval-plugin/LICENSE b/plugins/hls-eval-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-eval-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-eval-plugin/hls-eval-plugin.cabal b/plugins/hls-eval-plugin/hls-eval-plugin.cabal deleted file mode 100644 index bb75818286..0000000000 --- a/plugins/hls-eval-plugin/hls-eval-plugin.cabal +++ /dev/null @@ -1,113 +0,0 @@ -cabal-version: 2.4 -name: hls-eval-plugin -version: 2.6.0.0 -synopsis: Eval plugin for Haskell Language Server -description: - Please see the README on GitHub at - -category: Development -bug-reports: https://github.com/haskell/haskell-language-server/issues -license: Apache-2.0 -license-file: LICENSE -author: - https://github.com/haskell/haskell-language-server/contributors - -maintainer: - https://github.com/haskell/haskell-language-server/contributors - -build-type: Simple -extra-source-files: - LICENSE - README.md - test/cabal.project - test/testdata/info-util/*.cabal - test/testdata/info-util/*.hs - test/testdata/*.cabal - test/testdata/*.hs - test/testdata/*.lhs - test/testdata/*.yaml - -flag pedantic - description: Enable -Werror - default: False - manual: True - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server - -common warnings - ghc-options: - -Wall -Wunused-packages -Wno-name-shadowing -Wno-unticked-promoted-constructors -fno-ignore-asserts - -library - import: warnings - exposed-modules: - Ide.Plugin.Eval - Ide.Plugin.Eval.Types - - hs-source-dirs: src - other-modules: - Ide.Plugin.Eval.Code - Ide.Plugin.Eval.CodeLens - Ide.Plugin.Eval.Config - Ide.Plugin.Eval.GHC - Ide.Plugin.Eval.Parse.Comments - Ide.Plugin.Eval.Parse.Option - Ide.Plugin.Eval.Rules - Ide.Plugin.Eval.Util - - build-depends: - , aeson - , base >=4.12 && <5 - , bytestring - , containers - , deepseq - , Diff ^>=0.4.0 - , dlist - , extra - , filepath - , ghc - , ghc-boot-th - , ghcide == 2.6.0.0 - , hls-graph - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , lsp-types - , megaparsec >=9.0 - , mtl - , parser-combinators >=1.2 - , text - , transformers - , unliftio - , unordered-containers - - if flag(pedantic) - ghc-options: -Werror - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts - build-depends: - , aeson - , base - , containers - , extra - , filepath - , hls-eval-plugin - , hls-plugin-api - , hls-test-utils == 2.6.0.0 - , lens - , lsp-types - , text - , row-types diff --git a/plugins/hls-eval-plugin/test/Main.hs b/plugins/hls-eval-plugin/test/Main.hs index b213d8223f..3b34c1130f 100644 --- a/plugins/hls-eval-plugin/test/Main.hs +++ b/plugins/hls-eval-plugin/test/Main.hs @@ -286,7 +286,7 @@ codeLensTestOutput codeLens = do testOutput =<< sectionTests testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-eval-plugin" "test" "testdata" changeConfig :: [Pair] -> Config changeConfig conf = diff --git a/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs b/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs new file mode 100644 index 0000000000..2c8e0ef92a --- /dev/null +++ b/plugins/hls-eval-plugin/test/testdata/TFlags.ghc98.expected.hs @@ -0,0 +1,64 @@ +-- Support for language options + +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE Haskell2010 #-} + +module TFlags where + +-- Language options set in the module source (ScopedTypeVariables) +-- also apply to tests so this works fine +-- >>> f = (\(c::Char) -> [c]) + +{- Multiple options can be set with a single `:set` + +>>> :set -XMultiParamTypeClasses -XFlexibleInstances +>>> class Z a b c +-} + +{- + +Options apply only in the section where they are defined (unless they are in the setup section), so this will fail: + +>>> class L a b c +Too many parameters for class `L' +(Enable MultiParamTypeClasses to allow multi-parameter classes) +In the class declaration for `L' +-} + + +{- +Options apply to all tests in the same section after their declaration. + +Not set yet: + +>>> class D +No parameters for class `D' +(Enable MultiParamTypeClasses to allow no-parameter classes) +In the class declaration for `D' + +Now it works: + +>>>:set -XMultiParamTypeClasses +>>> class C + +It still works + +>>> class F +-} + +{- Now -package flag is handled correctly: + +>>> :set -package ghc-prim +>>> import GHC.Prim + +-} + + +{- Invalid option/flags are reported, but valid ones will be reflected + +>>> :set -XRank2Types -XAbsent -XDatatypeContexts -XWrong -fprint-nothing-at-all +: warning: + -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. +Some flags have not been recognized: -XAbsent, -XWrong, -fprint-nothing-at-all + +-} diff --git a/plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc96.expected.hs b/plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc96.expected.hs new file mode 100644 index 0000000000..a90fd16600 --- /dev/null +++ b/plugins/hls-eval-plugin/test/testdata/TPropertyError.ghc96.expected.hs @@ -0,0 +1,13 @@ +-- Support for property checking +module TProperty where + +-- prop> \(l::[Bool]) -> head l +-- *** Failed! (after 1 test): +-- Exception: +-- Prelude.head: empty list +-- CallStack (from HasCallStack): +-- error, called at libraries/base/GHC/List.hs:1644:3 in base:GHC.List +-- errorEmptyList, called at libraries/base/GHC/List.hs:87:11 in base:GHC.List +-- badHead, called at libraries/base/GHC/List.hs:83:28 in base:GHC.List +-- head, called at :1:27 in interactive:Ghci2 +-- [] diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 7cb8994bdf..33445f734a 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -11,7 +11,6 @@ packages: # - ./shake-bench - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-code-range-plugin - - ./plugins/hls-eval-plugin - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-imports-plugin - ./plugins/hls-explicit-record-fields-plugin diff --git a/stack.yaml b/stack.yaml index 5ba3f92a93..aafa879770 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,7 +11,6 @@ packages: # - ./shake-bench - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-code-range-plugin - - ./plugins/hls-eval-plugin - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-imports-plugin - ./plugins/hls-explicit-record-fields-plugin From fdf652cc7b606a9565eae3181547ed4276b76920 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:42:36 +0000 Subject: [PATCH 08/39] Explicit imports plugin --- cabal.project | 1 - haskell-language-server.cabal | 46 ++++ plugins/hls-explicit-imports-plugin/LICENSE | 201 ------------------ .../hls-explicit-imports-plugin.cabal | 74 ------- .../hls-explicit-imports-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 47 insertions(+), 279 deletions(-) delete mode 100644 plugins/hls-explicit-imports-plugin/LICENSE delete mode 100644 plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal diff --git a/cabal.project b/cabal.project index 43563a40e1..f490da4dd1 100644 --- a/cabal.project +++ b/cabal.project @@ -10,7 +10,6 @@ packages: ./hls-test-utils ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin - ./plugins/hls-explicit-imports-plugin ./plugins/hls-hlint-plugin ./plugins/hls-rename-plugin ./plugins/hls-retrie-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 7c546ed459..e804d39d3b 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -435,6 +435,52 @@ flag importLens default: True manual: True +library hls-explicit-imports-plugin + import: warnings + exposed-modules: Ide.Plugin.ExplicitImports + hs-source-dirs: plugins/hls-explicit-imports-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , deepseq + , ghc + , ghcide == 2.6.0.0 + , hls-graph + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , mtl + , text + , transformers + , unordered-containers + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + + if flag(pedantic) + ghc-options: -Werror + +test-suite hls-explicit-imports-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-explicit-imports-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , extra + , filepath + , hls-explicit-imports-plugin + , hls-test-utils + , lens + , lsp-types + , row-types + , text + ----------------------------- -- rename plugin ----------------------------- diff --git a/plugins/hls-explicit-imports-plugin/LICENSE b/plugins/hls-explicit-imports-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-explicit-imports-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal deleted file mode 100644 index 4bc7cfe53d..0000000000 --- a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal +++ /dev/null @@ -1,74 +0,0 @@ -cabal-version: 2.2 -name: hls-explicit-imports-plugin -version: 2.6.0.0 -synopsis: Explicit imports plugin for Haskell Language Server -description: - Please see the README on GitHub at -license: Apache-2.0 -license-file: LICENSE -author: Pepe Iborra -maintainer: pepeiborra@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -flag pedantic - description: Enable -Werror - default: False - manual: True - -common warnings - ghc-options: -Wall - -library - import: warnings - exposed-modules: Ide.Plugin.ExplicitImports - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , deepseq - , ghc - , ghcide == 2.6.0.0 - , hls-graph - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , mtl - , text - , transformers - , unordered-containers - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - - if flag(pedantic) - ghc-options: -Werror - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , extra - , filepath - , hls-explicit-imports-plugin - , hls-test-utils - , lens - , lsp-types - , row-types - , text diff --git a/plugins/hls-explicit-imports-plugin/test/Main.hs b/plugins/hls-explicit-imports-plugin/test/Main.hs index 1ff799bbfb..883734413c 100644 --- a/plugins/hls-explicit-imports-plugin/test/Main.hs +++ b/plugins/hls-explicit-imports-plugin/test/Main.hs @@ -174,7 +174,7 @@ goldenWithImportActions :: String -> FilePath -> ClientCapabilities -> (TextDocu goldenWithImportActions title fp caps = goldenWithHaskellAndCaps def caps explicitImportsPlugin (fp <> title <> " (golden)") testDataDir fp "expected" "hs" testDataDir :: String -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-explicit-imports-plugin" "test" "testdata" pointRange :: Int -> Int -> Range pointRange diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 33445f734a..bb87898075 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -12,7 +12,6 @@ packages: - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-code-range-plugin - ./plugins/hls-explicit-fixity-plugin - - ./plugins/hls-explicit-imports-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin diff --git a/stack.yaml b/stack.yaml index aafa879770..dfcedb4ed3 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,7 +12,6 @@ packages: - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-code-range-plugin - ./plugins/hls-explicit-fixity-plugin - - ./plugins/hls-explicit-imports-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin From 14efdfa4b15e48b40384d67ec0307db4e0a330d0 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:47:02 +0000 Subject: [PATCH 09/39] Rename plugin --- cabal.project | 1 - haskell-language-server.cabal | 42 ++++ plugins/hls-rename-plugin/LICENSE | 201 ------------------ .../hls-rename-plugin/hls-rename-plugin.cabal | 63 ------ plugins/hls-rename-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 43 insertions(+), 268 deletions(-) delete mode 100644 plugins/hls-rename-plugin/LICENSE delete mode 100644 plugins/hls-rename-plugin/hls-rename-plugin.cabal diff --git a/cabal.project b/cabal.project index f490da4dd1..5665a51dbc 100644 --- a/cabal.project +++ b/cabal.project @@ -11,7 +11,6 @@ packages: ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin ./plugins/hls-hlint-plugin - ./plugins/hls-rename-plugin ./plugins/hls-retrie-plugin ./plugins/hls-splice-plugin ./plugins/hls-floskell-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index e804d39d3b..56b96f5e50 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -495,6 +495,48 @@ common rename build-depends: hls-rename-plugin == 2.6.0.0 cpp-options: -Dhls_rename +library hls-rename-plugin + exposed-modules: Ide.Plugin.Rename + hs-source-dirs: plugins/hls-rename-plugin/src + build-depends: + , base >=4.12 && <5 + , containers + , extra + , ghc + , ghc-exactprint + , ghcide == 2.6.0.0 + , hashable + , hiedb + , hie-compat + , hls-plugin-api == 2.6.0.0 + , hls-refactor-plugin + , lens + , lsp + , lsp-types + , mtl + , mod + , syb + , text + , transformers + , unordered-containers + + default-language: Haskell2010 + +test-suite hls-rename-plugin-tests + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-rename-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , aeson + , base + , containers + , filepath + , hls-plugin-api + , hls-rename-plugin + , hls-test-utils == 2.6.0.0 + ----------------------------- -- retrie plugin ----------------------------- diff --git a/plugins/hls-rename-plugin/LICENSE b/plugins/hls-rename-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-rename-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-rename-plugin/hls-rename-plugin.cabal b/plugins/hls-rename-plugin/hls-rename-plugin.cabal deleted file mode 100644 index f78f7f96b9..0000000000 --- a/plugins/hls-rename-plugin/hls-rename-plugin.cabal +++ /dev/null @@ -1,63 +0,0 @@ -cabal-version: 2.4 -name: hls-rename-plugin -version: 2.6.0.0 -synopsis: Rename plugin for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Oliver Madine -maintainer: madine.oliver@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -library - exposed-modules: Ide.Plugin.Rename - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , containers - , extra - , ghc - , ghc-exactprint - , ghcide == 2.6.0.0 - , hashable - , hiedb - , hie-compat - , hls-plugin-api == 2.6.0.0 - , hls-refactor-plugin - , lens - , lsp - , lsp-types - , mtl - , mod - , syb - , text - , transformers - , unordered-containers - - default-language: Haskell2010 - -test-suite tests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , aeson - , base - , containers - , filepath - , hls-plugin-api - , hls-rename-plugin - , hls-test-utils == 2.6.0.0 diff --git a/plugins/hls-rename-plugin/test/Main.hs b/plugins/hls-rename-plugin/test/Main.hs index e9cfd83c8d..1d45c1e6f2 100644 --- a/plugins/hls-rename-plugin/test/Main.hs +++ b/plugins/hls-rename-plugin/test/Main.hs @@ -72,4 +72,4 @@ goldenWithRename title path act = goldenWithHaskellDoc (def { plugins = M.fromList [("rename", def { plcConfig = "crossModule" .= True })] }) renamePlugin title testDataDir path "expected" "hs" act testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-rename-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index bb87898075..3d90d00cca 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -23,7 +23,6 @@ packages: - ./plugins/hls-pragmas-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - - ./plugins/hls-rename-plugin - ./plugins/hls-retrie-plugin - ./plugins/hls-splice-plugin - ./plugins/hls-stan-plugin diff --git a/stack.yaml b/stack.yaml index dfcedb4ed3..98269f8bf7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -23,7 +23,6 @@ packages: - ./plugins/hls-pragmas-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - - ./plugins/hls-rename-plugin - ./plugins/hls-retrie-plugin - ./plugins/hls-splice-plugin - ./plugins/hls-stan-plugin From 4085813676ab52c0a0a0cda387137f1b5fa50a3c Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:50:08 +0000 Subject: [PATCH 10/39] Retrie plugin --- cabal.project | 1 - haskell-language-server.cabal | 51 +++++ plugins/hls-retrie-plugin/LICENSE | 201 ------------------ .../hls-retrie-plugin/hls-retrie-plugin.cabal | 72 ------- plugins/hls-retrie-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 52 insertions(+), 277 deletions(-) delete mode 100644 plugins/hls-retrie-plugin/LICENSE delete mode 100644 plugins/hls-retrie-plugin/hls-retrie-plugin.cabal diff --git a/cabal.project b/cabal.project index 5665a51dbc..034245ed85 100644 --- a/cabal.project +++ b/cabal.project @@ -11,7 +11,6 @@ packages: ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin ./plugins/hls-hlint-plugin - ./plugins/hls-retrie-plugin ./plugins/hls-splice-plugin ./plugins/hls-floskell-plugin ./plugins/hls-pragmas-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 56b96f5e50..0f11c507b9 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -551,6 +551,57 @@ common retrie build-depends: hls-retrie-plugin == 2.6.0.0 cpp-options: -Dhls_retrie +library hls-retrie-plugin + exposed-modules: Ide.Plugin.Retrie + hs-source-dirs: plugins/hls-retrie-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , bytestring + , containers + , deepseq + , directory + , extra + , ghc + , ghcide == 2.6.0.0 + , hashable + , hls-plugin-api == 2.6.0.0 + , hls-refactor-plugin + , lens + , lsp + , lsp-types + , mtl + , retrie >=0.1.1.0 + , safe-exceptions + , stm + , text + , transformers + , unordered-containers + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + + ghc-options: -Wno-unticked-promoted-constructors + +test-suite hls-retrie-plugin-tests + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-retrie-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , aeson + , base + , containers + , filepath + , hls-plugin-api + , hls-refactor-plugin + , hls-retrie-plugin + , hls-test-utils == 2.6.0.0 + , text + ----------------------------- -- hlint plugin ----------------------------- diff --git a/plugins/hls-retrie-plugin/LICENSE b/plugins/hls-retrie-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-retrie-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal deleted file mode 100644 index 20f4794c44..0000000000 --- a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal +++ /dev/null @@ -1,72 +0,0 @@ -cabal-version: 2.2 -name: hls-retrie-plugin -version: 2.6.0.0 -synopsis: Retrie integration plugin for Haskell Language Server -description: - Please see the README on GitHub at -license: Apache-2.0 -license-file: LICENSE -author: Pepe Iborra -maintainer: pepeiborra@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/Main.hs - test/testdata/*.hs - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -library - exposed-modules: Ide.Plugin.Retrie - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , bytestring - , containers - , deepseq - , directory - , extra - , ghc - , ghcide == 2.6.0.0 - , hashable - , hls-plugin-api == 2.6.0.0 - , hls-refactor-plugin - , lens - , lsp - , lsp-types - , mtl - , retrie >=0.1.1.0 - , safe-exceptions - , stm - , text - , transformers - , unordered-containers - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - - ghc-options: -Wno-unticked-promoted-constructors - -test-suite tests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , aeson - , base - , containers - , filepath - , hls-plugin-api - , hls-refactor-plugin - , hls-retrie-plugin - , hls-test-utils == 2.6.0.0 - , text diff --git a/plugins/hls-retrie-plugin/test/Main.hs b/plugins/hls-retrie-plugin/test/Main.hs index 5f8d12658a..551c9782bc 100644 --- a/plugins/hls-retrie-plugin/test/Main.hs +++ b/plugins/hls-retrie-plugin/test/Main.hs @@ -91,4 +91,4 @@ testPlugins = refactorPlugin -- needed for the GetAnnotatedParsedSource rule testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-retrie-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 3d90d00cca..48adb7cc61 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -23,7 +23,6 @@ packages: - ./plugins/hls-pragmas-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - - ./plugins/hls-retrie-plugin - ./plugins/hls-splice-plugin - ./plugins/hls-stan-plugin - ./plugins/hls-stylish-haskell-plugin diff --git a/stack.yaml b/stack.yaml index 98269f8bf7..1f61f6181f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -23,7 +23,6 @@ packages: - ./plugins/hls-pragmas-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - - ./plugins/hls-retrie-plugin - ./plugins/hls-splice-plugin - ./plugins/hls-stan-plugin - ./plugins/hls-stylish-haskell-plugin From 4a1e590b9f8060f4659189aaf89b560afd5af9eb Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:53:44 +0000 Subject: [PATCH 11/39] Hlint plugin --- cabal.project | 1 - haskell-language-server.cabal | 66 ++++++ plugins/hls-hlint-plugin/LICENSE | 201 ------------------ .../hls-hlint-plugin/hls-hlint-plugin.cabal | 96 --------- plugins/hls-hlint-plugin/test/Main.hs | 4 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 68 insertions(+), 302 deletions(-) delete mode 100644 plugins/hls-hlint-plugin/LICENSE delete mode 100644 plugins/hls-hlint-plugin/hls-hlint-plugin.cabal diff --git a/cabal.project b/cabal.project index 034245ed85..20831c8890 100644 --- a/cabal.project +++ b/cabal.project @@ -10,7 +10,6 @@ packages: ./hls-test-utils ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin - ./plugins/hls-hlint-plugin ./plugins/hls-splice-plugin ./plugins/hls-floskell-plugin ./plugins/hls-pragmas-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 0f11c507b9..6ad57c6200 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -616,6 +616,72 @@ common hlint build-depends: hls-hlint-plugin == 2.6.0.0 cpp-options: -Dhls_hlint +library hls-hlint-plugin + exposed-modules: Ide.Plugin.Hlint + hs-source-dirs: plugins/hls-hlint-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , binary + , bytestring + , containers + , data-default + , deepseq + , Diff ^>=0.4.0 + , directory + , extra + , filepath + , ghc-exactprint >=0.6.3.4 + , ghcide == 2.6.0.0 + , hashable + , hlint >= 3.5 && < 3.9 + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , mtl + , refact + , regex-tdfa + , stm + , temporary + , text + , transformers + , unordered-containers + , ghc-lib-parser + , ghc-lib-parser-ex + , apply-refact + + cpp-options: -DHLINT_ON_GHC_LIB + ghc-options: + -Wall -Wredundant-constraints -Wno-name-shadowing + -Wno-unticked-promoted-constructors + + if flag(pedantic) + ghc-options: -Werror + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + +test-suite hls-hlint-plugin-tests + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-hlint-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + aeson + , base + , containers + , filepath + , hls-hlint-plugin + , hls-plugin-api + , hls-test-utils == 2.6.0.0 + , lens + , lsp-types + , row-types + , text + ----------------------------- -- stan plugin ----------------------------- diff --git a/plugins/hls-hlint-plugin/LICENSE b/plugins/hls-hlint-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-hlint-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal deleted file mode 100644 index c384fb1990..0000000000 --- a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal +++ /dev/null @@ -1,96 +0,0 @@ -cabal-version: 2.4 -name: hls-hlint-plugin -version: 2.6.0.0 -synopsis: Hlint integration plugin with Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -maintainer: atreyu.bbb@gmail.com -copyright: The Haskell IDE Team -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.yaml - -- this one is not matched by the previous glob - test/testdata/ignore/.hlint.yaml - test/testdata/**/*.hs - test/testdata/**/*.h - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -flag pedantic - description: Enable -Werror - default: False - manual: True - -library - exposed-modules: Ide.Plugin.Hlint - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , binary - , bytestring - , containers - , data-default - , deepseq - , Diff ^>=0.4.0 - , directory - , extra - , filepath - , ghc-exactprint >=0.6.3.4 - , ghcide == 2.6.0.0 - , hashable - , hlint >= 3.5 && < 3.9 - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , mtl - , refact - , regex-tdfa - , stm - , temporary - , text - , transformers - , unordered-containers - , ghc-lib-parser - , ghc-lib-parser-ex - , apply-refact - - cpp-options: -DHLINT_ON_GHC_LIB - ghc-options: - -Wall -Wredundant-constraints -Wno-name-shadowing - -Wno-unticked-promoted-constructors - - if flag(pedantic) - ghc-options: -Werror - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - -test-suite tests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - aeson - , base - , containers - , filepath - , hls-hlint-plugin - , hls-plugin-api - , hls-test-utils == 2.6.0.0 - , lens - , lsp-types - , row-types - , text diff --git a/plugins/hls-hlint-plugin/test/Main.hs b/plugins/hls-hlint-plugin/test/Main.hs index 11d80262bc..f97fb57f11 100644 --- a/plugins/hls-hlint-plugin/test/Main.hs +++ b/plugins/hls-hlint-plugin/test/Main.hs @@ -121,7 +121,7 @@ suggestionsTests = contents <- skipManyTill anyMessage $ getDocumentEdit doc liftIO $ contents @?= "main = undefined\nfoo x = x\n" - , testCase "falls back to pre 3.8 code actions" $ runSessionWithServerAndCaps def hlintPlugin noLiteralCaps "test/testdata" $ do + , testCase "falls back to pre 3.8 code actions" $ runSessionWithServerAndCaps def hlintPlugin noLiteralCaps testDir $ do doc <- openDoc "Base.hs" "haskell" _ <- waitForDiagnosticsFromSource doc "hlint" @@ -337,7 +337,7 @@ configTests = testGroup "hlint plugin config" [ ] testDir :: FilePath -testDir = "test/testdata" +testDir = "plugins/hls-hlint-plugin/test/testdata" runHlintSession :: FilePath -> Session a -> IO a runHlintSession subdir = failIfSessionTimeout . runSessionWithServerAndCaps def hlintPlugin codeActionNoResolveCaps (testDir subdir) diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 48adb7cc61..71ccc57564 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -16,7 +16,6 @@ packages: - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-gadt-plugin - - ./plugins/hls-hlint-plugin - ./plugins/hls-module-name-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin diff --git a/stack.yaml b/stack.yaml index 1f61f6181f..460813e8bb 100644 --- a/stack.yaml +++ b/stack.yaml @@ -16,7 +16,6 @@ packages: - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-gadt-plugin - - ./plugins/hls-hlint-plugin - ./plugins/hls-module-name-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin From 7f49d9b69e724b4dd508da1daa3035f182505020 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 16:59:42 +0000 Subject: [PATCH 12/39] stan plugin --- cabal.project | 1 - haskell-language-server.cabal | 60 ++++++ plugins/hls-stan-plugin/LICENSE | 201 ------------------ plugins/hls-stan-plugin/hls-stan-plugin.cabal | 86 -------- plugins/hls-stan-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 61 insertions(+), 291 deletions(-) delete mode 100644 plugins/hls-stan-plugin/LICENSE delete mode 100644 plugins/hls-stan-plugin/hls-stan-plugin.cabal diff --git a/cabal.project b/cabal.project index 20831c8890..7b3df0c6cf 100644 --- a/cabal.project +++ b/cabal.project @@ -18,7 +18,6 @@ packages: ./plugins/hls-qualify-imported-names-plugin ./plugins/hls-code-range-plugin ./plugins/hls-change-type-signature-plugin - ./plugins/hls-stan-plugin ./plugins/hls-gadt-plugin ./plugins/hls-explicit-fixity-plugin ./plugins/hls-explicit-record-fields-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 6ad57c6200..2079e478af 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -696,6 +696,66 @@ common stan build-depends: hls-stan-plugin == 2.6.0.0 cpp-options: -Dhls_stan +library hls-stan-plugin + if (impl(ghc > 8.8.1) && impl(ghc <= 9.2.3) || impl(ghc >= 9.4.0) && impl(ghc < 9.10.0)) + buildable: True + else + buildable: False + exposed-modules: Ide.Plugin.Stan + hs-source-dirs: plugins/hls-stan-plugin/src + build-depends: + base + , containers + , data-default + , deepseq + , hashable + , hie-compat + , hls-plugin-api + , ghc + , ghcide + , lsp-types + , text + , transformers + , unordered-containers + , stan >= 0.1.2.0 + , trial + , directory + + default-language: Haskell2010 + default-extensions: + LambdaCase + NamedFieldPuns + DeriveGeneric + TypeFamilies + StandaloneDeriving + DuplicateRecordFields + OverloadedStrings + +test-suite hls-stan-plugin-tests + if (impl(ghc > 8.8.1) && impl(ghc <= 9.2.3) || impl(ghc >= 9.4.0) && impl(ghc < 9.10.0)) + buildable: True + else + buildable: False + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-stan-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + aeson + , base + , containers + , filepath + , hls-stan-plugin + , hls-plugin-api + , hls-test-utils == 2.6.0.0 + , lens + , lsp-types + , text + default-extensions: + NamedFieldPuns + OverloadedStrings + ----------------------------- -- module name plugin ----------------------------- diff --git a/plugins/hls-stan-plugin/LICENSE b/plugins/hls-stan-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-stan-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-stan-plugin/hls-stan-plugin.cabal b/plugins/hls-stan-plugin/hls-stan-plugin.cabal deleted file mode 100644 index 748d0a5ba1..0000000000 --- a/plugins/hls-stan-plugin/hls-stan-plugin.cabal +++ /dev/null @@ -1,86 +0,0 @@ -cabal-version: 2.4 -name: hls-stan-plugin -version: 2.6.0.0 -synopsis: Stan integration plugin with Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -maintainer: uhbif19@gmail.com -copyright: The Haskell IDE Team -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -flag pedantic - description: Enable -Werror - default: False - manual: True - -library - if (impl(ghc > 8.8.1) && impl(ghc <= 9.2.3) || impl(ghc >= 9.4.0) && impl(ghc < 9.10.0)) - buildable: True - else - buildable: False - exposed-modules: Ide.Plugin.Stan - hs-source-dirs: src - build-depends: - base - , containers - , data-default - , deepseq - , hashable - , hie-compat - , hls-plugin-api - , ghc - , ghcide - , lsp-types - , text - , transformers - , unordered-containers - , stan >= 0.1.2.0 - , trial - , directory - - default-language: Haskell2010 - default-extensions: - LambdaCase - NamedFieldPuns - DeriveGeneric - TypeFamilies - StandaloneDeriving - DuplicateRecordFields - OverloadedStrings - -test-suite test - if (impl(ghc > 8.8.1) && impl(ghc <= 9.2.3) || impl(ghc >= 9.4.0) && impl(ghc < 9.10.0)) - buildable: True - else - buildable: False - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - aeson - , base - , containers - , filepath - , hls-stan-plugin - , hls-plugin-api - , hls-test-utils == 2.6.0.0 - , lens - , lsp-types - , text - default-extensions: - NamedFieldPuns - OverloadedStrings diff --git a/plugins/hls-stan-plugin/test/Main.hs b/plugins/hls-stan-plugin/test/Main.hs index 7b668ea250..5388fd44d7 100644 --- a/plugins/hls-stan-plugin/test/Main.hs +++ b/plugins/hls-stan-plugin/test/Main.hs @@ -43,7 +43,7 @@ tests = ] testDir :: FilePath -testDir = "test/testdata" +testDir = "plugins/hls-stan-plugin/test/testdata" stanPlugin :: PluginTestDescriptor Stan.Log stanPlugin = mkPluginTestDescriptor enabledStanDescriptor "stan" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 71ccc57564..22bf837953 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -23,7 +23,6 @@ packages: - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-splice-plugin - - ./plugins/hls-stan-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin diff --git a/stack.yaml b/stack.yaml index 460813e8bb..29564e16c7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -23,7 +23,6 @@ packages: - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-splice-plugin - - ./plugins/hls-stan-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin From d62db077d6d69e065350a510dbb0691e30c4bf00 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 18:10:32 +0000 Subject: [PATCH 13/39] Module name plugin --- cabal.project | 1 - haskell-language-server.cabal | 31 +++ plugins/hls-module-name-plugin/LICENSE | 201 ------------------ .../hls-module-name-plugin.cabal | 58 ----- plugins/hls-module-name-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 32 insertions(+), 263 deletions(-) delete mode 100644 plugins/hls-module-name-plugin/LICENSE delete mode 100644 plugins/hls-module-name-plugin/hls-module-name-plugin.cabal diff --git a/cabal.project b/cabal.project index 7b3df0c6cf..90e9b890c7 100644 --- a/cabal.project +++ b/cabal.project @@ -13,7 +13,6 @@ packages: ./plugins/hls-splice-plugin ./plugins/hls-floskell-plugin ./plugins/hls-pragmas-plugin - ./plugins/hls-module-name-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-qualify-imported-names-plugin ./plugins/hls-code-range-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 2079e478af..f69154858a 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -770,6 +770,37 @@ common moduleName build-depends: hls-module-name-plugin == 2.6.0.0 cpp-options: -Dhls_moduleName +library hls-module-name-plugin + import: warnings + exposed-modules: Ide.Plugin.ModuleName + hs-source-dirs: plugins/hls-module-name-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , directory + , filepath + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp + , text + , transformers + + default-language: Haskell2010 + +test-suite hls-module-name-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-module-name-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , hls-module-name-plugin + , hls-test-utils == 2.6.0.0 + ----------------------------- -- pragmas plugin ----------------------------- diff --git a/plugins/hls-module-name-plugin/LICENSE b/plugins/hls-module-name-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-module-name-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-module-name-plugin/hls-module-name-plugin.cabal b/plugins/hls-module-name-plugin/hls-module-name-plugin.cabal deleted file mode 100644 index 671e2af351..0000000000 --- a/plugins/hls-module-name-plugin/hls-module-name-plugin.cabal +++ /dev/null @@ -1,58 +0,0 @@ -cabal-version: 2.4 -name: hls-module-name-plugin -version: 2.6.0.0 -synopsis: Module name plugin for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: alan.zimm@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.yaml - test/testdata/**/*.hs - test/testdata/**/*.cabal - test/testdata/**/*.project - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.ModuleName - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , directory - , filepath - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp - , text - , transformers - - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , hls-module-name-plugin - , hls-test-utils == 2.6.0.0 diff --git a/plugins/hls-module-name-plugin/test/Main.hs b/plugins/hls-module-name-plugin/test/Main.hs index de3e71d8be..ba1ed756e5 100644 --- a/plugins/hls-module-name-plugin/test/Main.hs +++ b/plugins/hls-module-name-plugin/test/Main.hs @@ -63,4 +63,4 @@ goldenWithModuleName :: TestName -> FilePath -> (TextDocumentIdentifier -> Sessi goldenWithModuleName title path = goldenWithHaskellDoc def moduleNamePlugin title testDataDir path "expected" "hs" testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-module-name-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 22bf837953..ae7617ff61 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -16,7 +16,6 @@ packages: - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-gadt-plugin - - ./plugins/hls-module-name-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-pragmas-plugin diff --git a/stack.yaml b/stack.yaml index 29564e16c7..a2d5b2e8e4 100644 --- a/stack.yaml +++ b/stack.yaml @@ -16,7 +16,6 @@ packages: - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-gadt-plugin - - ./plugins/hls-module-name-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-pragmas-plugin From 1d5714c94d315c06785ccc9fff53edc45735baf8 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 18:10:43 +0000 Subject: [PATCH 14/39] pragmas plugin --- cabal.project | 1 - haskell-language-server.cabal | 34 +++ plugins/hls-pragmas-plugin/LICENSE | 201 ------------------ .../hls-pragmas-plugin.cabal | 59 ----- plugins/hls-pragmas-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 35 insertions(+), 264 deletions(-) delete mode 100644 plugins/hls-pragmas-plugin/LICENSE delete mode 100644 plugins/hls-pragmas-plugin/hls-pragmas-plugin.cabal diff --git a/cabal.project b/cabal.project index 90e9b890c7..3ca8a835e0 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-splice-plugin ./plugins/hls-floskell-plugin - ./plugins/hls-pragmas-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-qualify-imported-names-plugin ./plugins/hls-code-range-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index f69154858a..6e23a263ed 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -815,6 +815,40 @@ common pragmas build-depends: hls-pragmas-plugin == 2.6.0.0 cpp-options: -Dhls_pragmas +library hls-pragmas-plugin + import: warnings + exposed-modules: Ide.Plugin.Pragmas + hs-source-dirs: plugins/hls-pragmas-plugin/src + build-depends: + , base >=4.12 && <5 + , extra + , fuzzy + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , text + , transformers + , containers + default-language: Haskell2010 + +test-suite hls-pragmas-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-pragmas-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , aeson + , base + , filepath + , hls-pragmas-plugin + , hls-test-utils == 2.6.0.0 + , lens + , lsp-types + , text + ----------------------------- -- splice plugin ----------------------------- diff --git a/plugins/hls-pragmas-plugin/LICENSE b/plugins/hls-pragmas-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-pragmas-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-pragmas-plugin/hls-pragmas-plugin.cabal b/plugins/hls-pragmas-plugin/hls-pragmas-plugin.cabal deleted file mode 100644 index 32617e2418..0000000000 --- a/plugins/hls-pragmas-plugin/hls-pragmas-plugin.cabal +++ /dev/null @@ -1,59 +0,0 @@ -cabal-version: 2.4 -name: hls-pragmas-plugin -version: 2.6.0.0 -synopsis: Pragmas plugin for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: alan.zimm@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.Pragmas - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , extra - , fuzzy - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , text - , transformers - , containers - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , aeson - , base - , filepath - , hls-pragmas-plugin - , hls-test-utils == 2.6.0.0 - , lens - , lsp-types - , text diff --git a/plugins/hls-pragmas-plugin/test/Main.hs b/plugins/hls-pragmas-plugin/test/Main.hs index 0b8e690dd9..e6f0b220b6 100644 --- a/plugins/hls-pragmas-plugin/test/Main.hs +++ b/plugins/hls-pragmas-plugin/test/Main.hs @@ -214,4 +214,4 @@ goldenWithPragmas :: PluginTestDescriptor () -> TestName -> FilePath -> (TextDoc goldenWithPragmas descriptor title path = goldenWithHaskellDoc def descriptor title testDataDir path "expected" "hs" testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-pragmas-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index ae7617ff61..2c5749c836 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -18,7 +18,6 @@ packages: - ./plugins/hls-gadt-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - - ./plugins/hls-pragmas-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-splice-plugin diff --git a/stack.yaml b/stack.yaml index a2d5b2e8e4..2887bcf90a 100644 --- a/stack.yaml +++ b/stack.yaml @@ -18,7 +18,6 @@ packages: - ./plugins/hls-gadt-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - - ./plugins/hls-pragmas-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-splice-plugin From f75545e9fb2e74a94bc33d5e2e4a4754e7e5066c Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 18:14:53 +0000 Subject: [PATCH 15/39] Splice plugin --- cabal.project | 1 - haskell-language-server.cabal | 48 +++++ plugins/hls-splice-plugin/LICENSE | 201 ------------------ .../hls-splice-plugin/hls-splice-plugin.cabal | 75 ------- plugins/hls-splice-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 49 insertions(+), 280 deletions(-) delete mode 100644 plugins/hls-splice-plugin/LICENSE delete mode 100644 plugins/hls-splice-plugin/hls-splice-plugin.cabal diff --git a/cabal.project b/cabal.project index 3ca8a835e0..303e489238 100644 --- a/cabal.project +++ b/cabal.project @@ -10,7 +10,6 @@ packages: ./hls-test-utils ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin - ./plugins/hls-splice-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-qualify-imported-names-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 6e23a263ed..17a9eea744 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -863,6 +863,54 @@ common splice build-depends: hls-splice-plugin == 2.6.0.0 cpp-options: -Dhls_splice +library hls-splice-plugin + exposed-modules: + Ide.Plugin.Splice + Ide.Plugin.Splice.Types + + ghc-options: -Wall -Wno-unticked-promoted-constructors + hs-source-dirs: plugins/hls-splice-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , dlist + , extra + , foldl + , ghc + , ghc-exactprint + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , hls-refactor-plugin + , lens + , lsp + , mtl + , retrie + , syb + , text + , transformers + , unliftio-core + , unordered-containers + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + +test-suite hls-splice-plugin-tests + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-splice-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , hls-splice-plugin + , hls-test-utils == 2.6.0.0 + , text + , row-types + ----------------------------- -- alternate number format plugin ----------------------------- diff --git a/plugins/hls-splice-plugin/LICENSE b/plugins/hls-splice-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-splice-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-splice-plugin/hls-splice-plugin.cabal b/plugins/hls-splice-plugin/hls-splice-plugin.cabal deleted file mode 100644 index 571fa43103..0000000000 --- a/plugins/hls-splice-plugin/hls-splice-plugin.cabal +++ /dev/null @@ -1,75 +0,0 @@ -cabal-version: 2.4 -name: hls-splice-plugin -version: 2.6.0.0 -synopsis: - HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes - -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: - https://github.com/haskell/haskell-language-server/contributors - -maintainer: - https://github.com/haskell/haskell-language-server/contributors - -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -library - exposed-modules: - Ide.Plugin.Splice - Ide.Plugin.Splice.Types - - ghc-options: -Wall -Wno-unticked-promoted-constructors - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , dlist - , extra - , foldl - , ghc - , ghc-exactprint - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , hls-refactor-plugin - , lens - , lsp - , mtl - , retrie - , syb - , text - , transformers - , unliftio-core - , unordered-containers - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - -test-suite tests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , hls-splice-plugin - , hls-test-utils == 2.6.0.0 - , text - , row-types diff --git a/plugins/hls-splice-plugin/test/Main.hs b/plugins/hls-splice-plugin/test/Main.hs index 4f57273d8e..73ddba3f5c 100644 --- a/plugins/hls-splice-plugin/test/Main.hs +++ b/plugins/hls-splice-plugin/test/Main.hs @@ -109,7 +109,7 @@ goldenTestWithEdit fp expect tc line col = _ -> liftIO $ assertFailure "No CodeAction detected" testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-splice-plugin" "test" "testdata" pointRange :: Int -> Int -> Range pointRange (subtract 1 -> fromIntegral -> line) (subtract 1 -> fromIntegral -> col) = diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 2c5749c836..4434451a5a 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -20,7 +20,6 @@ packages: - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - - ./plugins/hls-splice-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin diff --git a/stack.yaml b/stack.yaml index 2887bcf90a..abe8f4db46 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,7 +20,6 @@ packages: - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - - ./plugins/hls-splice-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin From a25e40814b7e64ff84ad436d0240bd5560f00088 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 18:18:44 +0000 Subject: [PATCH 16/39] Qualify imported names plugin --- cabal.project | 1 - haskell-language-server.cabal | 37 ++++ .../hls-qualify-imported-names-plugin/LICENSE | 201 ------------------ .../hls-qualify-imported-names-plugin.cabal | 59 ----- .../test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 38 insertions(+), 264 deletions(-) delete mode 100644 plugins/hls-qualify-imported-names-plugin/LICENSE delete mode 100644 plugins/hls-qualify-imported-names-plugin/hls-qualify-imported-names-plugin.cabal diff --git a/cabal.project b/cabal.project index 303e489238..fd5d0cce3d 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-qualify-imported-names-plugin ./plugins/hls-code-range-plugin ./plugins/hls-change-type-signature-plugin ./plugins/hls-gadt-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 17a9eea744..00b49199aa 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -990,6 +990,43 @@ common qualifyImportedNames build-depends: hls-qualify-imported-names-plugin == 2.6.0.0 cpp-options: -Dhls_qualifyImportedNames +library hls-qualify-imported-names-plugin + exposed-modules: Ide.Plugin.QualifyImportedNames + hs-source-dirs: plugins/hls-qualify-imported-names-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , deepseq + , ghc + , ghcide == 2.6.0.0 + , hls-graph + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , text + , unordered-containers + , dlist + , transformers + + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators + +test-suite hls-qualify-imported-names-tests + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-qualify-imported-names-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , text + , filepath + , hls-qualify-imported-names-plugin + , hls-test-utils == 2.6.0.0 + ----------------------------- -- code range plugin ----------------------------- diff --git a/plugins/hls-qualify-imported-names-plugin/LICENSE b/plugins/hls-qualify-imported-names-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-qualify-imported-names-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-qualify-imported-names-plugin/hls-qualify-imported-names-plugin.cabal b/plugins/hls-qualify-imported-names-plugin/hls-qualify-imported-names-plugin.cabal deleted file mode 100644 index 0e9016deb2..0000000000 --- a/plugins/hls-qualify-imported-names-plugin/hls-qualify-imported-names-plugin.cabal +++ /dev/null @@ -1,59 +0,0 @@ -cabal-version: 2.2 -name: hls-qualify-imported-names-plugin -version: 2.6.0.0 -synopsis: A Haskell Language Server plugin that qualifies imported names -description: - Please see the README on GitHub at -license: Apache-2.0 -license-file: LICENSE -author: Jonathan Shen -maintainer: shenjonathan0@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - qualify-imported-names-demo.gif - README.md - test/data/*.hs - test/data/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -library - exposed-modules: Ide.Plugin.QualifyImportedNames - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , deepseq - , ghc - , ghcide == 2.6.0.0 - , hls-graph - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , text - , unordered-containers - , dlist - , transformers - - default-language: Haskell2010 - default-extensions: - DataKinds - TypeOperators - -test-suite tests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , text - , filepath - , hls-qualify-imported-names-plugin - , hls-test-utils == 2.6.0.0 diff --git a/plugins/hls-qualify-imported-names-plugin/test/Main.hs b/plugins/hls-qualify-imported-names-plugin/test/Main.hs index 9ea46b210c..664b7053b9 100644 --- a/plugins/hls-qualify-imported-names-plugin/test/Main.hs +++ b/plugins/hls-qualify-imported-names-plugin/test/Main.hs @@ -127,7 +127,7 @@ codeActionGoldenTest testCaseName goldenFilename point = _ -> liftIO $ assertFailure $ makeCodeActionNotFoundAtString point testDataDir :: String -testDataDir = "test" "data" +testDataDir = "plugins" "hls-qualify-imported-names-plugin" "test" "data" pluginDescriptor :: PluginTestDescriptor () pluginDescriptor = mkPluginTestDescriptor' QualifyImportedNames.descriptor "qualifyImportedNames" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 4434451a5a..9ffe925b16 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -18,7 +18,6 @@ packages: - ./plugins/hls-gadt-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin diff --git a/stack.yaml b/stack.yaml index abe8f4db46..01667c6bde 100644 --- a/stack.yaml +++ b/stack.yaml @@ -18,7 +18,6 @@ packages: - ./plugins/hls-gadt-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - - ./plugins/hls-qualify-imported-names-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin From 4a6d43df1aa14e5f6c8a6e08ddd5bb5acd74ee8a Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:27:39 +0000 Subject: [PATCH 17/39] code range plugin --- cabal.project | 1 - haskell-language-server.cabal | 46 ++++ plugins/hls-code-range-plugin/LICENSE | 201 ------------------ .../hls-code-range-plugin.cabal | 72 ------- plugins/hls-code-range-plugin/test/Main.hs | 4 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 48 insertions(+), 278 deletions(-) delete mode 100644 plugins/hls-code-range-plugin/LICENSE delete mode 100644 plugins/hls-code-range-plugin/hls-code-range-plugin.cabal diff --git a/cabal.project b/cabal.project index fd5d0cce3d..4c11414791 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-code-range-plugin ./plugins/hls-change-type-signature-plugin ./plugins/hls-gadt-plugin ./plugins/hls-explicit-fixity-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 00b49199aa..02d795cdff 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1041,6 +1041,52 @@ common codeRange build-depends: hls-code-range-plugin == 2.6.0.0 cpp-options: -Dhls_codeRange +library hls-code-range-plugin + import: warnings + exposed-modules: + Ide.Plugin.CodeRange + Ide.Plugin.CodeRange.Rules + other-modules: + Ide.Plugin.CodeRange.ASTPreProcess + hs-source-dirs: plugins/hls-code-range-plugin/src + default-language: Haskell2010 + build-depends: + , base >=4.12 && <5 + , containers + , deepseq + , extra + , ghcide == 2.6.0.0 + , hashable + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , mtl + , semigroupoids + , transformers + , vector + +test-suite hls-code-range-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-code-range-plugin/test + main-is: Main.hs + other-modules: + Ide.Plugin.CodeRangeTest + Ide.Plugin.CodeRange.RulesTest + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , bytestring + , filepath + , hls-code-range-plugin + , hls-test-utils == 2.6.0.0 + , lens + , lsp + , lsp-test + , transformers + , vector + ----------------------------- -- change type signature plugin ----------------------------- diff --git a/plugins/hls-code-range-plugin/LICENSE b/plugins/hls-code-range-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-code-range-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-code-range-plugin/hls-code-range-plugin.cabal b/plugins/hls-code-range-plugin/hls-code-range-plugin.cabal deleted file mode 100644 index 0ac2dcdd81..0000000000 --- a/plugins/hls-code-range-plugin/hls-code-range-plugin.cabal +++ /dev/null @@ -1,72 +0,0 @@ -cabal-version: 2.4 -name: hls-code-range-plugin -version: 2.6.0.0 -synopsis: - HLS Plugin to support smart selection range and Folding range - -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: kokobd -maintainer: kokobd - -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: - Ide.Plugin.CodeRange - Ide.Plugin.CodeRange.Rules - other-modules: - Ide.Plugin.CodeRange.ASTPreProcess - hs-source-dirs: src - default-language: Haskell2010 - build-depends: - , base >=4.12 && <5 - , containers - , deepseq - , extra - , ghcide == 2.6.0.0 - , hashable - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , mtl - , semigroupoids - , transformers - , vector - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - other-modules: - Ide.Plugin.CodeRangeTest - Ide.Plugin.CodeRange.RulesTest - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , bytestring - , filepath - , hls-code-range-plugin - , hls-test-utils == 2.6.0.0 - , lens - , lsp - , lsp-test - , transformers - , vector diff --git a/plugins/hls-code-range-plugin/test/Main.hs b/plugins/hls-code-range-plugin/test/Main.hs index b51297b893..e10c45035b 100644 --- a/plugins/hls-code-range-plugin/test/Main.hs +++ b/plugins/hls-code-range-plugin/test/Main.hs @@ -48,7 +48,7 @@ selectionRangeGoldenTest testName positions = goldenGitDiff testName (testDataDi Right golden -> pure golden where testDataDir :: FilePath - testDataDir = "test" "testdata" "selection-range" + testDataDir = "plugins" "hls-code-range-plugin" "test" "testdata" "selection-range" showSelectionRangesForTest :: [SelectionRange] -> ByteString showSelectionRangesForTest selectionRanges = LBSChar8.intercalate "\n" $ fmap showSelectionRangeForTest selectionRanges @@ -78,7 +78,7 @@ foldingRangeGoldenTest testName = goldenGitDiff testName (testDataDir testN where testDataDir :: FilePath - testDataDir = "test" "testdata" "folding-range" + testDataDir = "plugins" "hls-code-range-plugin" "test" "testdata" "folding-range" showFoldingRangesForTest :: [FoldingRange] -> ByteString showFoldingRangesForTest foldingRanges = (LBSChar8.intercalate "\n" $ fmap showFoldingRangeForTest foldingRanges) `LBSChar8.snoc` '\n' diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 9ffe925b16..8f4289edf5 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -10,7 +10,6 @@ packages: - ./hls-test-utils # - ./shake-bench - ./plugins/hls-change-type-signature-plugin - - ./plugins/hls-code-range-plugin - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin diff --git a/stack.yaml b/stack.yaml index 01667c6bde..dccdc6d8f0 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,7 +10,6 @@ packages: - ./hls-test-utils # - ./shake-bench - ./plugins/hls-change-type-signature-plugin - - ./plugins/hls-code-range-plugin - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin From 0a437f116748d3c7b081fe837666157b01ca05a7 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:29:51 +0000 Subject: [PATCH 18/39] change type signature plugin --- cabal.project | 1 - haskell-language-server.cabal | 46 ++++ .../hls-change-type-signature-plugin/LICENSE | 201 ------------------ .../hls-change-type-signature-plugin.cabal | 72 ------- .../test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 47 insertions(+), 277 deletions(-) delete mode 100644 plugins/hls-change-type-signature-plugin/LICENSE delete mode 100644 plugins/hls-change-type-signature-plugin/hls-change-type-signature-plugin.cabal diff --git a/cabal.project b/cabal.project index 4c11414791..a6089a8b15 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-change-type-signature-plugin ./plugins/hls-gadt-plugin ./plugins/hls-explicit-fixity-plugin ./plugins/hls-explicit-record-fields-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 02d795cdff..fba2ce0618 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1101,6 +1101,52 @@ common changeTypeSignature build-depends: hls-change-type-signature-plugin == 2.6.0.0 cpp-options: -Dhls_changeTypeSignature +library hls-change-type-signature-plugin + import: warnings + exposed-modules: Ide.Plugin.ChangeTypeSignature + hs-source-dirs: plugins/hls-change-type-signature-plugin/src + build-depends: + , base >=4.12 && < 5 + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp-types + , regex-tdfa + , syb + , text + , transformers + , containers + default-language: Haskell2010 + default-extensions: + ConstraintKinds + DataKinds + ExplicitNamespaces + FlexibleContexts + NamedFieldPuns + OverloadedStrings + RecordWildCards + TypeOperators + + +test-suite hls-change-type-signature-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-change-type-signature-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts + build-depends: + , base >=4.12 && < 5 + , filepath + , hls-change-type-signature-plugin + , hls-test-utils == 2.6.0.0 + , regex-tdfa + , text + default-extensions: + NamedFieldPuns + OverloadedStrings + TypeOperators + ViewPatterns + ----------------------------- -- gadt plugin ----------------------------- diff --git a/plugins/hls-change-type-signature-plugin/LICENSE b/plugins/hls-change-type-signature-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-change-type-signature-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-change-type-signature-plugin/hls-change-type-signature-plugin.cabal b/plugins/hls-change-type-signature-plugin/hls-change-type-signature-plugin.cabal deleted file mode 100644 index 6b55b3a60c..0000000000 --- a/plugins/hls-change-type-signature-plugin/hls-change-type-signature-plugin.cabal +++ /dev/null @@ -1,72 +0,0 @@ -cabal-version: 2.4 -name: hls-change-type-signature-plugin -version: 2.6.0.0 -synopsis: Change a declarations type signature with a Code Action -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Nick Suchecki -maintainer: nicksuchecki@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - README.md - test/testdata/*.hs - test/testdata/*.txt - test/testdata/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.ChangeTypeSignature - hs-source-dirs: src - build-depends: - , base >=4.12 && < 5 - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp-types - , regex-tdfa - , syb - , text - , transformers - , containers - default-language: Haskell2010 - default-extensions: - ConstraintKinds - DataKinds - ExplicitNamespaces - FlexibleContexts - NamedFieldPuns - OverloadedStrings - RecordWildCards - TypeOperators - - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts - build-depends: - , base >=4.12 && < 5 - , filepath - , hls-change-type-signature-plugin - , hls-test-utils == 2.6.0.0 - , regex-tdfa - , text - default-extensions: - NamedFieldPuns - OverloadedStrings - TypeOperators - ViewPatterns diff --git a/plugins/hls-change-type-signature-plugin/test/Main.hs b/plugins/hls-change-type-signature-plugin/test/Main.hs index 543d4452dc..e41957c976 100644 --- a/plugins/hls-change-type-signature-plugin/test/Main.hs +++ b/plugins/hls-change-type-signature-plugin/test/Main.hs @@ -88,7 +88,7 @@ testRegex921One = testGroup "Regex One" [ regex = errorMessageRegexes !! 2 testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-change-type-signature-plugin" "test" "testdata" goldenChangeSignature :: FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree goldenChangeSignature fp = goldenWithHaskellDoc def changeTypeSignaturePlugin (fp <> " (golden)") testDataDir fp "expected" "hs" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 8f4289edf5..eb2738d52e 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin diff --git a/stack.yaml b/stack.yaml index dccdc6d8f0..77121e9ba8 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-change-type-signature-plugin - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin From ca81cbcdb5aa279232869712ed1330b9509214b9 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:31:37 +0000 Subject: [PATCH 19/39] gadt plugin --- cabal.project | 1 - haskell-language-server.cabal | 39 ++++ plugins/hls-gadt-plugin/LICENSE | 201 ------------------ plugins/hls-gadt-plugin/hls-gadt-plugin.cabal | 66 ------ plugins/hls-gadt-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 40 insertions(+), 271 deletions(-) delete mode 100644 plugins/hls-gadt-plugin/LICENSE delete mode 100644 plugins/hls-gadt-plugin/hls-gadt-plugin.cabal diff --git a/cabal.project b/cabal.project index a6089a8b15..9f71ea35e4 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-gadt-plugin ./plugins/hls-explicit-fixity-plugin ./plugins/hls-explicit-record-fields-plugin ./plugins/hls-refactor-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index fba2ce0618..6c2787aa5e 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1161,6 +1161,45 @@ common gadt build-depends: hls-gadt-plugin == 2.6.0.0 cpp-options: -Dhls_gadt +library hls-gadt-plugin + import: warnings + exposed-modules: Ide.Plugin.GADT + other-modules: Ide.Plugin.GHC + + hs-source-dirs: plugins/hls-gadt-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , extra + , ghc + , ghcide == 2.6.0.0 + , ghc-exactprint + , hls-plugin-api == 2.6.0.0 + , hls-refactor-plugin + , lens + , lsp >=2.3 + , mtl + , text + , transformers + + default-language: Haskell2010 + default-extensions: DataKinds + +test-suite hls-gadt-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-gadt-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , hls-gadt-plugin + , hls-test-utils == 2.6.0.0 + , text + ----------------------------- -- explicit fixity plugin ----------------------------- diff --git a/plugins/hls-gadt-plugin/LICENSE b/plugins/hls-gadt-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-gadt-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-gadt-plugin/hls-gadt-plugin.cabal b/plugins/hls-gadt-plugin/hls-gadt-plugin.cabal deleted file mode 100644 index 87f5f828ef..0000000000 --- a/plugins/hls-gadt-plugin/hls-gadt-plugin.cabal +++ /dev/null @@ -1,66 +0,0 @@ -cabal-version: 2.4 -name: hls-gadt-plugin -version: 2.6.0.0 -synopsis: Convert to GADT syntax plugin -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Lei Zhu -maintainer: julytreee@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: - -Wall - -Wunused-packages - -Wno-name-shadowing - -Wno-unticked-promoted-constructors - -library - import: warnings - exposed-modules: Ide.Plugin.GADT - other-modules: Ide.Plugin.GHC - - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , extra - , ghc - , ghcide == 2.6.0.0 - , ghc-exactprint - , hls-plugin-api == 2.6.0.0 - , hls-refactor-plugin - , lens - , lsp >=2.3 - , mtl - , text - , transformers - - default-language: Haskell2010 - default-extensions: DataKinds - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , hls-gadt-plugin - , hls-test-utils == 2.6.0.0 - , text diff --git a/plugins/hls-gadt-plugin/test/Main.hs b/plugins/hls-gadt-plugin/test/Main.hs index d36abc6347..d2c090376b 100644 --- a/plugins/hls-gadt-plugin/test/Main.hs +++ b/plugins/hls-gadt-plugin/test/Main.hs @@ -72,4 +72,4 @@ isGADTCodeAction CodeAction{..} = case _kind of _ -> False testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-gadt-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index eb2738d52e..34365609d6 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -13,7 +13,6 @@ packages: - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - - ./plugins/hls-gadt-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-refactor-plugin diff --git a/stack.yaml b/stack.yaml index 77121e9ba8..0ad81a3aac 100644 --- a/stack.yaml +++ b/stack.yaml @@ -13,7 +13,6 @@ packages: - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - - ./plugins/hls-gadt-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-refactor-plugin From 258a981fe03cf5c84d792e2fe106951d43797066 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:33:29 +0000 Subject: [PATCH 20/39] explicit fixity plugin --- cabal.project | 1 - haskell-language-server.cabal | 33 +++ plugins/hls-explicit-fixity-plugin/LICENSE | 201 ------------------ .../hls-explicit-fixity-plugin.cabal | 58 ----- .../hls-explicit-fixity-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 34 insertions(+), 263 deletions(-) delete mode 100644 plugins/hls-explicit-fixity-plugin/LICENSE delete mode 100644 plugins/hls-explicit-fixity-plugin/hls-explicit-fixity-plugin.cabal diff --git a/cabal.project b/cabal.project index 9f71ea35e4..c256a52284 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-explicit-fixity-plugin ./plugins/hls-explicit-record-fields-plugin ./plugins/hls-refactor-plugin ./plugins/hls-overloaded-record-dot-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 6c2787aa5e..deb7767e0b 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1214,6 +1214,39 @@ common explicitFixity build-depends: hls-explicit-fixity-plugin == 2.6.0.0 cpp-options: -DexplicitFixity +library hls-explicit-fixity-plugin + import: warnings + exposed-modules: Ide.Plugin.ExplicitFixity + + hs-source-dirs: plugins/hls-explicit-fixity-plugin/src + build-depends: + base >=4.12 && <5 + , containers + , deepseq + , extra + , ghcide == 2.6.0.0 + , hashable + , hls-plugin-api == 2.6.0.0 + , lsp >=2.3 + , text + + default-language: Haskell2010 + default-extensions: DataKinds + +test-suite hls-explicit-fixity-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-explicit-fixity-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , hls-explicit-fixity-plugin + , hls-test-utils == 2.6.0.0 + , text + ----------------------------- -- explicit fields plugin ----------------------------- diff --git a/plugins/hls-explicit-fixity-plugin/LICENSE b/plugins/hls-explicit-fixity-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-explicit-fixity-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-explicit-fixity-plugin/hls-explicit-fixity-plugin.cabal b/plugins/hls-explicit-fixity-plugin/hls-explicit-fixity-plugin.cabal deleted file mode 100644 index da10bbfca6..0000000000 --- a/plugins/hls-explicit-fixity-plugin/hls-explicit-fixity-plugin.cabal +++ /dev/null @@ -1,58 +0,0 @@ -cabal-version: 2.4 -name: hls-explicit-fixity-plugin -version: 2.6.0.0 -synopsis: Show fixity explicitly while hovering -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Lei Zhu -maintainer: julytreee@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: - -Wall -Wunused-packages - -Wno-name-shadowing -Wno-unticked-promoted-constructors - -library - import: warnings - exposed-modules: Ide.Plugin.ExplicitFixity - - hs-source-dirs: src - build-depends: - base >=4.12 && <5 - , containers - , deepseq - , extra - , ghcide == 2.6.0.0 - , hashable - , hls-plugin-api == 2.6.0.0 - , lsp >=2.3 - , text - - default-language: Haskell2010 - default-extensions: DataKinds - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , hls-explicit-fixity-plugin - , hls-test-utils == 2.6.0.0 - , text diff --git a/plugins/hls-explicit-fixity-plugin/test/Main.hs b/plugins/hls-explicit-fixity-plugin/test/Main.hs index c35401baad..6cfcc16c60 100644 --- a/plugins/hls-explicit-fixity-plugin/test/Main.hs +++ b/plugins/hls-explicit-fixity-plugin/test/Main.hs @@ -67,4 +67,4 @@ hoverTest' docName title pos expected = testCase title $ runSessionWithServer de closeDoc doc testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-explicit-fixity-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 34365609d6..7670713b04 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin diff --git a/stack.yaml b/stack.yaml index 0ad81a3aac..9dd11cce38 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-explicit-fixity-plugin - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin From 516cd6f6f64ec705de248919f60171c22f8e7105 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:36:05 +0000 Subject: [PATCH 21/39] explicit record fields plugin --- cabal.project | 1 - haskell-language-server.cabal | 35 +++++++++++ .../hls-explicit-record-fields-plugin/LICENSE | 30 --------- .../hls-explicit-record-fields-plugin.cabal | 63 ------------------- .../test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 36 insertions(+), 97 deletions(-) delete mode 100644 plugins/hls-explicit-record-fields-plugin/LICENSE delete mode 100644 plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal diff --git a/cabal.project b/cabal.project index c256a52284..1c1ec75344 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,6 @@ packages: ./plugins/hls-fourmolu-plugin ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin - ./plugins/hls-explicit-record-fields-plugin ./plugins/hls-refactor-plugin ./plugins/hls-overloaded-record-dot-plugin ./plugins/hls-semantic-tokens-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index deb7767e0b..b9183df8bc 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1261,6 +1261,41 @@ common explicitFields build-depends: hls-explicit-record-fields-plugin == 2.6.0.0 cpp-options: -DexplicitFields +library hls-explicit-record-fields-plugin + import: warnings + exposed-modules: Ide.Plugin.ExplicitFields + build-depends: + , base >=4.12 && <5 + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp + , lens + , hls-graph + , text + , syb + , transformers + , containers + , aeson + hs-source-dirs: plugins/hls-explicit-record-fields-plugin/src + default-language: Haskell2010 + + if flag(pedantic) + ghc-options: -Werror + -Wwarn=incomplete-record-updates + +test-suite hls-explicit-record-fields-plugin-tests + import: warnings + default-language: Haskell2010 + type: exitcode-stdio-1.0 + hs-source-dirs: plugins/hls-explicit-record-fields-plugin/test + main-is: Main.hs + build-depends: + , base + , filepath + , text + , hls-explicit-record-fields-plugin + , hls-test-utils + ----------------------------- -- overloaded record dot plugin ----------------------------- diff --git a/plugins/hls-explicit-record-fields-plugin/LICENSE b/plugins/hls-explicit-record-fields-plugin/LICENSE deleted file mode 100644 index 00abc29fb4..0000000000 --- a/plugins/hls-explicit-record-fields-plugin/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2022, Berk Ozkutuk - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Berk Ozkutuk nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal b/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal deleted file mode 100644 index 8e3e16ed8e..0000000000 --- a/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal +++ /dev/null @@ -1,63 +0,0 @@ -cabal-version: 3.0 -name: hls-explicit-record-fields-plugin -version: 2.6.0.0 -synopsis: Explicit record fields plugin for Haskell Language Server -description: - Please see the README on GitHub at -license: BSD-3-Clause -license-file: LICENSE -author: Berk Ozkutuk -maintainer: berk.ozkutuk@tweag.io --- copyright: -category: Development -build-type: Simple -extra-doc-files: CHANGELOG.md -extra-source-files: - test/testdata/**/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server - -flag pedantic - description: Enable -Werror - default: False - manual: True - -common warnings - ghc-options: -Wall -Wunused-packages -Wincomplete-record-updates - -library - import: warnings - exposed-modules: Ide.Plugin.ExplicitFields - build-depends: - , base >=4.12 && <5 - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp - , lens - , hls-graph - , text - , syb - , transformers - , containers - , aeson - hs-source-dirs: src - default-language: Haskell2010 - - if flag(pedantic) - ghc-options: -Werror - -Wwarn=incomplete-record-updates - -test-suite tests - import: warnings - default-language: Haskell2010 - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Main.hs - build-depends: - , base - , filepath - , text - , hls-explicit-record-fields-plugin - , hls-test-utils diff --git a/plugins/hls-explicit-record-fields-plugin/test/Main.hs b/plugins/hls-explicit-record-fields-plugin/test/Main.hs index 4e83ccbd80..1c6cafc0bd 100644 --- a/plugins/hls-explicit-record-fields-plugin/test/Main.hs +++ b/plugins/hls-explicit-record-fields-plugin/test/Main.hs @@ -69,4 +69,4 @@ isExplicitFieldsCodeAction CodeAction {_title} = "Expand record wildcard" `T.isPrefixOf` _title testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-explicit-record-fields-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 7670713b04..dc5c4fc415 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin diff --git a/stack.yaml b/stack.yaml index 9dd11cce38..b722042250 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-explicit-record-fields-plugin - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin From 288e6e2088c6b8c764dc9ed42d3e48ca8d11fb32 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:38:43 +0000 Subject: [PATCH 22/39] Overloaded record dot plugin --- cabal.project | 1 - haskell-language-server.cabal | 33 +++++++++++ .../hls-overloaded-record-dot-plugin/LICENSE | 30 ---------- .../hls-overloaded-record-dot-plugin.cabal | 55 ------------------- .../test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 34 insertions(+), 89 deletions(-) delete mode 100644 plugins/hls-overloaded-record-dot-plugin/LICENSE delete mode 100644 plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal diff --git a/cabal.project b/cabal.project index 1c1ec75344..fa7b51fe72 100644 --- a/cabal.project +++ b/cabal.project @@ -13,7 +13,6 @@ packages: ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-refactor-plugin - ./plugins/hls-overloaded-record-dot-plugin ./plugins/hls-semantic-tokens-plugin index-state: 2024-01-21T00:00:00Z diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index b9183df8bc..09100f2de6 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1310,6 +1310,39 @@ common overloadedRecordDot build-depends: hls-overloaded-record-dot-plugin == 2.6.0.0 cpp-options: -Dhls_overloaded_record_dot +library hls-overloaded-record-dot-plugin + import: warnings + exposed-modules: Ide.Plugin.OverloadedRecordDot + build-depends: + , base >=4.16 && <5 + , aeson + , ghcide + , hls-plugin-api + , lsp + , lens + , hls-graph + , text + , syb + , transformers + , containers + , deepseq + hs-source-dirs: plugins/hls-overloaded-record-dot-plugin/src + default-language: GHC2021 + +test-suite hls-overloaded-record-dot-plugin-tests + import: warnings + default-language: GHC2021 + type: exitcode-stdio-1.0 + hs-source-dirs: plugins/hls-overloaded-record-dot-plugin/test + main-is: Main.hs + build-depends: + , base + , filepath + , text + , hls-overloaded-record-dot-plugin + , hls-test-utils + + ----------------------------- -- floskell plugin ----------------------------- diff --git a/plugins/hls-overloaded-record-dot-plugin/LICENSE b/plugins/hls-overloaded-record-dot-plugin/LICENSE deleted file mode 100644 index 16590f45c8..0000000000 --- a/plugins/hls-overloaded-record-dot-plugin/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2023, Nathan Maxson - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Nathan Maxson nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal b/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal deleted file mode 100644 index 4138cb87ec..0000000000 --- a/plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal +++ /dev/null @@ -1,55 +0,0 @@ -cabal-version: 3.0 -name: hls-overloaded-record-dot-plugin -version: 2.6.0.0 -synopsis: Overloaded record dot plugin for Haskell Language Server -description: - Please see the README on GitHub at -license: BSD-3-Clause -license-file: LICENSE -author: Nathan Maxson -maintainer: joyfulmantis@gmail.com -category: Development -build-type: Simple -extra-doc-files: CHANGELOG.md -extra-source-files: - test/testdata/**/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.OverloadedRecordDot - build-depends: - , base >=4.16 && <5 - , aeson - , ghcide - , hls-plugin-api - , lsp - , lens - , hls-graph - , text - , syb - , transformers - , containers - , deepseq - hs-source-dirs: src - default-language: GHC2021 - -test-suite tests - import: warnings - default-language: GHC2021 - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Main.hs - build-depends: - , base - , filepath - , text - , hls-overloaded-record-dot-plugin - , hls-test-utils - diff --git a/plugins/hls-overloaded-record-dot-plugin/test/Main.hs b/plugins/hls-overloaded-record-dot-plugin/test/Main.hs index e896951b67..dca323eb91 100644 --- a/plugins/hls-overloaded-record-dot-plugin/test/Main.hs +++ b/plugins/hls-overloaded-record-dot-plugin/test/Main.hs @@ -75,4 +75,4 @@ isExplicitFieldsCodeAction selectorName CodeAction {_title} = ("Convert `" <> selectorName <> "` to record dot syntax") `T.isPrefixOf` _title testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-overloaded-record-dot-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index dc5c4fc415..975f70b262 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -12,7 +12,6 @@ packages: - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin - - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin diff --git a/stack.yaml b/stack.yaml index b722042250..c2733fd041 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,7 +12,6 @@ packages: - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin - - ./plugins/hls-overloaded-record-dot-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin From 086e239e1683fa61086ec22c43957494ff38e02c Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:40:27 +0000 Subject: [PATCH 23/39] Floskell plugin --- cabal.project | 1 - haskell-language-server.cabal | 28 +++ plugins/hls-floskell-plugin/LICENSE | 201 ------------------ .../hls-floskell-plugin.cabal | 52 ----- plugins/hls-floskell-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 29 insertions(+), 257 deletions(-) delete mode 100644 plugins/hls-floskell-plugin/LICENSE delete mode 100644 plugins/hls-floskell-plugin/hls-floskell-plugin.cabal diff --git a/cabal.project b/cabal.project index fa7b51fe72..ed0da103f3 100644 --- a/cabal.project +++ b/cabal.project @@ -10,7 +10,6 @@ packages: ./hls-test-utils ./plugins/hls-stylish-haskell-plugin ./plugins/hls-fourmolu-plugin - ./plugins/hls-floskell-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-refactor-plugin ./plugins/hls-semantic-tokens-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 09100f2de6..ef2d9faa56 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1357,6 +1357,34 @@ common floskell build-depends: hls-floskell-plugin == 2.6.0.0 cpp-options: -Dhls_floskell +library hls-floskell-plugin + import: warnings + exposed-modules: Ide.Plugin.Floskell + hs-source-dirs: plugins/hls-floskell-plugin/src + build-depends: + , base >=4.12 && <5 + , floskell ^>=0.11.0 + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp-types ^>=2.1 + , mtl + , text + + default-language: Haskell2010 + +test-suite hls-floskell-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-floskell-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , hls-floskell-plugin + , hls-test-utils == 2.6.0.0 + ----------------------------- -- fourmolu plugin ----------------------------- diff --git a/plugins/hls-floskell-plugin/LICENSE b/plugins/hls-floskell-plugin/LICENSE deleted file mode 100644 index 16502c47e2..0000000000 --- a/plugins/hls-floskell-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 The Haskell IDE team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-floskell-plugin/hls-floskell-plugin.cabal b/plugins/hls-floskell-plugin/hls-floskell-plugin.cabal deleted file mode 100644 index bb50145920..0000000000 --- a/plugins/hls-floskell-plugin/hls-floskell-plugin.cabal +++ /dev/null @@ -1,52 +0,0 @@ -cabal-version: 2.4 -name: hls-floskell-plugin -version: 2.6.0.0 -synopsis: Integration with the Floskell code formatter -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: alan.zimm@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.Floskell - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , floskell ^>=0.11.0 - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp-types ^>=2.1 - , mtl - , text - - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , hls-floskell-plugin - , hls-test-utils == 2.6.0.0 diff --git a/plugins/hls-floskell-plugin/test/Main.hs b/plugins/hls-floskell-plugin/test/Main.hs index baf5513287..ba4c707130 100644 --- a/plugins/hls-floskell-plugin/test/Main.hs +++ b/plugins/hls-floskell-plugin/test/Main.hs @@ -27,4 +27,4 @@ goldenWithFloskell :: TestName -> FilePath -> FilePath -> (TextDocumentIdentifie goldenWithFloskell title path desc = goldenWithHaskellDocFormatter def floskellPlugin "floskell" def title testDataDir path desc "hs" testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-floskell-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 975f70b262..4101b697b5 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-refactor-plugin diff --git a/stack.yaml b/stack.yaml index c2733fd041..3e3d246e45 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-floskell-plugin - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-refactor-plugin From 80a6f3c3a7c9a34a0ed9644db47367dd790b0ab3 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:44:04 +0000 Subject: [PATCH 24/39] fourmolu plugin --- cabal.project | 1 - haskell-language-server.cabal | 39 ++++ plugins/hls-fourmolu-plugin/LICENSE | 201 ------------------ .../hls-fourmolu-plugin.cabal | 65 ------ plugins/hls-fourmolu-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 40 insertions(+), 270 deletions(-) delete mode 100644 plugins/hls-fourmolu-plugin/LICENSE delete mode 100644 plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal diff --git a/cabal.project b/cabal.project index ed0da103f3..3eee8b3c3e 100644 --- a/cabal.project +++ b/cabal.project @@ -9,7 +9,6 @@ packages: ./hls-plugin-api ./hls-test-utils ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-fourmolu-plugin ./plugins/hls-ormolu-plugin ./plugins/hls-refactor-plugin ./plugins/hls-semantic-tokens-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index ef2d9faa56..351cf32c65 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1399,6 +1399,45 @@ common fourmolu build-depends: hls-fourmolu-plugin == 2.6.0.0 cpp-options: -Dhls_fourmolu +library hls-fourmolu-plugin + import: warnings + exposed-modules: + Ide.Plugin.Fourmolu + hs-source-dirs: plugins/hls-fourmolu-plugin/src + build-depends: + , base >=4.12 && <5 + , filepath + , fourmolu ^>= 0.14 + , ghc-boot-th + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lens + , lsp + , mtl + , process-extras >= 0.7.1 + , text + , transformers + + default-language: Haskell2010 + +test-suite hls-fourmolu-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-fourmolu-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-tool-depends: + fourmolu:fourmolu + build-depends: + , base >=4.12 && <5 + , aeson + , filepath + , hls-fourmolu-plugin + , hls-plugin-api + , hls-test-utils == 2.6.0.0 + , lsp-test + ----------------------------- -- ormolu plugin ----------------------------- diff --git a/plugins/hls-fourmolu-plugin/LICENSE b/plugins/hls-fourmolu-plugin/LICENSE deleted file mode 100644 index 16502c47e2..0000000000 --- a/plugins/hls-fourmolu-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 The Haskell IDE team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal deleted file mode 100644 index f50437b46c..0000000000 --- a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal +++ /dev/null @@ -1,65 +0,0 @@ -cabal-version: 2.4 -name: hls-fourmolu-plugin -version: 2.6.0.0 -synopsis: Integration with the Fourmolu code formatter -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -homepage: https://github.com/haskell/haskell-language-server -bug-reports: https://github.com/haskell/haskell-language-server/issues -maintainer: alan.zimm@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.hs - -source-repository head - type: git - location: git://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: - Ide.Plugin.Fourmolu - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , filepath - , fourmolu ^>= 0.14 - , ghc-boot-th - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lens - , lsp - , mtl - , process-extras >= 0.7.1 - , text - , transformers - - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-tool-depends: - fourmolu:fourmolu - build-depends: - , base >=4.12 && <5 - , aeson - , filepath - , hls-fourmolu-plugin - , hls-plugin-api - , hls-test-utils == 2.6.0.0 - , lsp-test diff --git a/plugins/hls-fourmolu-plugin/test/Main.hs b/plugins/hls-fourmolu-plugin/test/Main.hs index 36d462b833..483fae8ac8 100644 --- a/plugins/hls-fourmolu-plugin/test/Main.hs +++ b/plugins/hls-fourmolu-plugin/test/Main.hs @@ -39,4 +39,4 @@ goldenWithFourmolu cli title path desc = goldenWithHaskellDocFormatter def fourm conf = def{plcConfig = KM.fromList ["external" .= cli]} testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-fourmolu-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 4101b697b5..e567327af6 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin diff --git a/stack.yaml b/stack.yaml index 3e3d246e45..87c7ad2652 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-fourmolu-plugin - ./plugins/hls-ormolu-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin From 24ad660fc55fb8f883ab2284def6df63d51a206c Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:46:05 +0000 Subject: [PATCH 25/39] ormolu plugin --- cabal.project | 1 - haskell-language-server.cabal | 39 ++++ plugins/hls-ormolu-plugin/LICENSE | 201 ------------------ .../hls-ormolu-plugin/hls-ormolu-plugin.cabal | 65 ------ plugins/hls-ormolu-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 40 insertions(+), 270 deletions(-) delete mode 100644 plugins/hls-ormolu-plugin/LICENSE delete mode 100644 plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal diff --git a/cabal.project b/cabal.project index 3eee8b3c3e..fc90e23720 100644 --- a/cabal.project +++ b/cabal.project @@ -9,7 +9,6 @@ packages: ./hls-plugin-api ./hls-test-utils ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-ormolu-plugin ./plugins/hls-refactor-plugin ./plugins/hls-semantic-tokens-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 351cf32c65..32f0cf95ab 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1452,6 +1452,45 @@ common ormolu build-depends: hls-ormolu-plugin == 2.6.0.0 cpp-options: -Dhls_ormolu +library hls-ormolu-plugin + import: warnings + exposed-modules: Ide.Plugin.Ormolu + hs-source-dirs: plugins/hls-ormolu-plugin/src + build-depends: + , base >=4.12 && <5 + , extra + , filepath + , ghc-boot-th + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp + , mtl + , process-extras >= 0.7.1 + , ormolu ^>=0.1.2 || ^>= 0.2 || ^>= 0.3 || ^>= 0.5 || ^>= 0.6 || ^>= 0.7 + , text + , transformers + + default-language: Haskell2010 + +test-suite hls-ormolu-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-ormolu-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-tool-depends: + ormolu:ormolu + build-depends: + , base + , aeson + , filepath + , hls-ormolu-plugin + , hls-plugin-api + , hls-test-utils == 2.6.0.0 + , lsp-types + , ormolu + ----------------------------- -- stylish-haskell plugin ----------------------------- diff --git a/plugins/hls-ormolu-plugin/LICENSE b/plugins/hls-ormolu-plugin/LICENSE deleted file mode 100644 index 16502c47e2..0000000000 --- a/plugins/hls-ormolu-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 The Haskell IDE team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal b/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal deleted file mode 100644 index 3a655b6814..0000000000 --- a/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal +++ /dev/null @@ -1,65 +0,0 @@ -cabal-version: 2.4 -name: hls-ormolu-plugin -version: 2.6.0.0 -synopsis: Integration with the Ormolu code formatter -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: alan.zimm@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.hs - test/testdata/.ormolu - test/testdata/test.cabal - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.Ormolu - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , extra - , filepath - , ghc-boot-th - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp - , mtl - , process-extras >= 0.7.1 - , ormolu ^>=0.1.2 || ^>= 0.2 || ^>= 0.3 || ^>= 0.5 || ^>= 0.6 || ^>= 0.7 - , text - , transformers - - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-tool-depends: - ormolu:ormolu - build-depends: - , base - , aeson - , filepath - , hls-ormolu-plugin - , hls-plugin-api - , hls-test-utils == 2.6.0.0 - , lsp-types - , ormolu diff --git a/plugins/hls-ormolu-plugin/test/Main.hs b/plugins/hls-ormolu-plugin/test/Main.hs index 512a7c343f..05f7a2a115 100644 --- a/plugins/hls-ormolu-plugin/test/Main.hs +++ b/plugins/hls-ormolu-plugin/test/Main.hs @@ -40,4 +40,4 @@ goldenWithOrmolu cli title path desc = conf = def{plcConfig = KM.fromList ["external" .= cli]} testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-ormolu-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index e567327af6..851145134f 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-ormolu-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin diff --git a/stack.yaml b/stack.yaml index 87c7ad2652..47b56d834e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-ormolu-plugin - ./plugins/hls-refactor-plugin - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin From ae6bf68d57bc93238dbf27f4f0f0f5f8d1a65e06 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:48:06 +0000 Subject: [PATCH 26/39] Stylish-haskell plugin --- cabal.project | 1 - haskell-language-server.cabal | 31 +++ plugins/hls-stylish-haskell-plugin/LICENSE | 201 ------------------ .../hls-stylish-haskell-plugin.cabal | 54 ----- .../hls-stylish-haskell-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 32 insertions(+), 259 deletions(-) delete mode 100644 plugins/hls-stylish-haskell-plugin/LICENSE delete mode 100644 plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal diff --git a/cabal.project b/cabal.project index fc90e23720..43f339e103 100644 --- a/cabal.project +++ b/cabal.project @@ -8,7 +8,6 @@ packages: ./ghcide/test ./hls-plugin-api ./hls-test-utils - ./plugins/hls-stylish-haskell-plugin ./plugins/hls-refactor-plugin ./plugins/hls-semantic-tokens-plugin diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 32f0cf95ab..77299b31ef 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1505,6 +1505,37 @@ common stylishHaskell build-depends: hls-stylish-haskell-plugin == 2.6.0.0 cpp-options: -Dhls_stylishHaskell +library hls-stylish-haskell-plugin + import: warnings + exposed-modules: Ide.Plugin.StylishHaskell + hs-source-dirs: plugins/hls-stylish-haskell-plugin/src + build-depends: + , base >=4.12 && <5 + , directory + , filepath + , ghc-boot-th + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp-types + , mtl + , stylish-haskell ^>=0.12 || ^>=0.13 || ^>=0.14.2 + , text + + default-language: Haskell2010 + +test-suite hls-stylish-haskell-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-stylish-haskell-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + , base + , filepath + , hls-stylish-haskell-plugin + , hls-test-utils == 2.6.0.0 + ----------------------------- -- refactor plugin ----------------------------- diff --git a/plugins/hls-stylish-haskell-plugin/LICENSE b/plugins/hls-stylish-haskell-plugin/LICENSE deleted file mode 100644 index 16502c47e2..0000000000 --- a/plugins/hls-stylish-haskell-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 The Haskell IDE team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal deleted file mode 100644 index 21a80bfcd9..0000000000 --- a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal +++ /dev/null @@ -1,54 +0,0 @@ -cabal-version: 2.4 -name: hls-stylish-haskell-plugin -version: 2.6.0.0 -synopsis: Integration with the Stylish Haskell code formatter -description: - Please see the README on GitHub at -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: alan.zimm@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.StylishHaskell - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , directory - , filepath - , ghc-boot-th - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp-types - , mtl - , stylish-haskell ^>=0.12 || ^>=0.13 || ^>=0.14.2 - , text - - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , filepath - , hls-stylish-haskell-plugin - , hls-test-utils == 2.6.0.0 diff --git a/plugins/hls-stylish-haskell-plugin/test/Main.hs b/plugins/hls-stylish-haskell-plugin/test/Main.hs index 9dadebf598..f8e55e8913 100644 --- a/plugins/hls-stylish-haskell-plugin/test/Main.hs +++ b/plugins/hls-stylish-haskell-plugin/test/Main.hs @@ -25,4 +25,4 @@ goldenWithStylishHaskell :: TestName -> FilePath -> FilePath -> (TextDocumentIde goldenWithStylishHaskell title fp desc = goldenWithHaskellDocFormatter def stylishHaskellPlugin "stylishHaskell" def title testDataDir fp desc "hs" testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-stylish-haskell-plugin" "test" "testdata" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 851145134f..22435c3ed4 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -10,7 +10,6 @@ packages: - ./hls-test-utils # - ./shake-bench - ./plugins/hls-refactor-plugin - - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin ghc-options: diff --git a/stack.yaml b/stack.yaml index 47b56d834e..f9d4cc2e34 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,7 +10,6 @@ packages: - ./hls-test-utils # - ./shake-bench - ./plugins/hls-refactor-plugin - - ./plugins/hls-stylish-haskell-plugin - ./plugins/hls-semantic-tokens-plugin ghc-options: From 3b8a2e24756ff1d9d3e34470b5e0f56295c73753 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:51:54 +0000 Subject: [PATCH 27/39] refactor plugin --- cabal.project | 1 - haskell-language-server.cabal | 102 +++++++++ plugins/hls-refactor-plugin/LICENSE | 201 ------------------ .../hls-refactor-plugin.cabal | 127 ----------- plugins/hls-refactor-plugin/test/Main.hs | 4 +- .../test/Test/AddArgument.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 8 files changed, 105 insertions(+), 334 deletions(-) delete mode 100644 plugins/hls-refactor-plugin/LICENSE delete mode 100644 plugins/hls-refactor-plugin/hls-refactor-plugin.cabal diff --git a/cabal.project b/cabal.project index 43f339e103..6710c06936 100644 --- a/cabal.project +++ b/cabal.project @@ -8,7 +8,6 @@ packages: ./ghcide/test ./hls-plugin-api ./hls-test-utils - ./plugins/hls-refactor-plugin ./plugins/hls-semantic-tokens-plugin index-state: 2024-01-21T00:00:00Z diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 77299b31ef..0c884b6e44 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1550,6 +1550,108 @@ common refactor build-depends: hls-refactor-plugin == 2.6.0.0 cpp-options: -Dhls_refactor +library hls-refactor-plugin + import: warnings + exposed-modules: Development.IDE.GHC.ExactPrint + Development.IDE.GHC.Compat.ExactPrint + Development.IDE.Plugin.CodeAction + Development.IDE.Plugin.CodeAction.Util + Development.IDE.GHC.Dump + other-modules: Development.IDE.Plugin.CodeAction.Args + Development.IDE.Plugin.CodeAction.ExactPrint + Development.IDE.Plugin.CodeAction.PositionIndexed + Development.IDE.Plugin.Plugins.AddArgument + Development.IDE.Plugin.Plugins.Diagnostic + Development.IDE.Plugin.Plugins.FillHole + Development.IDE.Plugin.Plugins.FillTypeWildcard + Development.IDE.Plugin.Plugins.ImportUtils + default-extensions: + BangPatterns + CPP + DataKinds + DeriveGeneric + DerivingStrategies + DerivingVia + DuplicateRecordFields + ExplicitNamespaces + FlexibleContexts + FlexibleInstances + FunctionalDependencies + GeneralizedNewtypeDeriving + LambdaCase + NamedFieldPuns + OverloadedStrings + PatternSynonyms + RankNTypes + RecordWildCards + ScopedTypeVariables + TupleSections + TypeApplications + TypeOperators + ViewPatterns + hs-source-dirs: plugins/hls-refactor-plugin/src + build-depends: + , base >=4.12 && <5 + , ghc + , bytestring + , ghc-boot + , regex-tdfa + , text-rope + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lsp + , text + , transformers + , unordered-containers + , containers + , ghc-exactprint < 1 || >= 1.4 + , extra + , retrie + , syb + , hls-graph + , dlist + , deepseq + , mtl + , lens + , data-default + , time + -- FIXME: Only needed to workaround for qualified imports in GHC 9.4 + , regex-applicative + , parser-combinators + ghc-options: -Wno-name-shadowing + default-language: Haskell2010 + +test-suite hls-refactor-plugin-tests + import: warnings + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: plugins/hls-refactor-plugin/test + main-is: Main.hs + other-modules: Test.AddArgument + ghc-options: -O0 -threaded -rtsopts -with-rtsopts=-N -Wno-name-shadowing + build-depends: + , base + , filepath + , hls-refactor-plugin + , hls-test-utils == 2.6.0.0 + , lens + , lsp-types + , text + , hls-plugin-api + , parser-combinators + , data-default + , extra + , ghcide + , ghcide-test-utils + , shake + , hls-plugin-api + , lsp-test + , directory + , regex-tdfa + , tasty-hunit + , tasty-expected-failure + , tasty + ----------------------------- -- semantic tokens plugin ----------------------------- diff --git a/plugins/hls-refactor-plugin/LICENSE b/plugins/hls-refactor-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-refactor-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-refactor-plugin/hls-refactor-plugin.cabal b/plugins/hls-refactor-plugin/hls-refactor-plugin.cabal deleted file mode 100644 index 6a8e07220b..0000000000 --- a/plugins/hls-refactor-plugin/hls-refactor-plugin.cabal +++ /dev/null @@ -1,127 +0,0 @@ -cabal-version: 3.0 -name: hls-refactor-plugin -version: 2.6.0.0 -synopsis: Exactprint refactorings for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: zubin.duggal@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/data/**/*.hs - test/data/**/*.yaml - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Development.IDE.GHC.ExactPrint - Development.IDE.GHC.Compat.ExactPrint - Development.IDE.Plugin.CodeAction - Development.IDE.Plugin.CodeAction.Util - Development.IDE.GHC.Dump - other-modules: Development.IDE.Plugin.CodeAction.Args - Development.IDE.Plugin.CodeAction.ExactPrint - Development.IDE.Plugin.CodeAction.PositionIndexed - Development.IDE.Plugin.Plugins.AddArgument - Development.IDE.Plugin.Plugins.Diagnostic - Development.IDE.Plugin.Plugins.FillHole - Development.IDE.Plugin.Plugins.FillTypeWildcard - Development.IDE.Plugin.Plugins.ImportUtils - default-extensions: - BangPatterns - CPP - DataKinds - DeriveGeneric - DerivingStrategies - DerivingVia - DuplicateRecordFields - ExplicitNamespaces - FlexibleContexts - FlexibleInstances - FunctionalDependencies - GeneralizedNewtypeDeriving - LambdaCase - NamedFieldPuns - OverloadedStrings - PatternSynonyms - RankNTypes - RecordWildCards - ScopedTypeVariables - TupleSections - TypeApplications - TypeOperators - ViewPatterns - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , ghc - , bytestring - , ghc-boot - , regex-tdfa - , text-rope - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lsp - , text - , transformers - , unordered-containers - , containers - , ghc-exactprint < 1 || >= 1.4 - , extra - , retrie - , syb - , hls-graph - , dlist - , deepseq - , mtl - , lens - , data-default - , time - -- FIXME: Only needed to workaround for qualified imports in GHC 9.4 - , regex-applicative - , parser-combinators - ghc-options: -Wno-name-shadowing - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - other-modules: Test.AddArgument - ghc-options: -O0 -threaded -rtsopts -with-rtsopts=-N -Wno-name-shadowing - build-depends: - , base - , filepath - , hls-refactor-plugin - , hls-test-utils == 2.6.0.0 - , lens - , lsp-types - , text - , hls-plugin-api - , parser-combinators - , data-default - , extra - , ghcide - , ghcide-test-utils - , shake - , hls-plugin-api - , lsp-test - , directory - , regex-tdfa - , tasty-hunit - , tasty-expected-failure - , tasty diff --git a/plugins/hls-refactor-plugin/test/Main.hs b/plugins/hls-refactor-plugin/test/Main.hs index 4408f79932..21c0e52270 100644 --- a/plugins/hls-refactor-plugin/test/Main.hs +++ b/plugins/hls-refactor-plugin/test/Main.hs @@ -3841,10 +3841,10 @@ runWithExtraFiles prefix s = withTempDir $ \dir -> do copyTestDataFiles :: HasCallStack => FilePath -> FilePath -> IO () copyTestDataFiles dir prefix = do -- Copy all the test data files to the temporary workspace - testDataFiles <- getDirectoryFilesIO ("test/data" prefix) ["//*"] + testDataFiles <- getDirectoryFilesIO ("plugins/hls-refactor-plugin/test/data" prefix) ["//*"] for_ testDataFiles $ \f -> do createDirectoryIfMissing True $ dir takeDirectory f - copyFile ("test/data" prefix f) (dir f) + copyFile ("plugins/hls-refactor-plugin/test/data" prefix f) (dir f) run :: Session a -> IO a run s = run' (const s) diff --git a/plugins/hls-refactor-plugin/test/Test/AddArgument.hs b/plugins/hls-refactor-plugin/test/Test/AddArgument.hs index 8d08624d40..65b16d19c8 100644 --- a/plugins/hls-refactor-plugin/test/Test/AddArgument.hs +++ b/plugins/hls-refactor-plugin/test/Test/AddArgument.hs @@ -64,7 +64,7 @@ mkGoldenAddArgTest' testFileName range varName = do def (mkPluginTestDescriptor Refactor.bindingsPluginDescriptor "ghcide-code-actions-bindings") (testFileName <> " (golden)") - (FS.mkVirtualFileTree "test/data/golden/add-arg" (FS.directProject $ testFileName <.> "hs")) + (FS.mkVirtualFileTree "plugins/hls-refactor-plugin/test/data/golden/add-arg" (FS.directProject $ testFileName <.> "hs")) testFileName "expected" "hs" diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 22435c3ed4..4c2a52cf93 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-refactor-plugin - ./plugins/hls-semantic-tokens-plugin ghc-options: diff --git a/stack.yaml b/stack.yaml index f9d4cc2e34..81db90f20a 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-refactor-plugin - ./plugins/hls-semantic-tokens-plugin ghc-options: From 25d74c229d01f6d9270957b8e8229c47735c5a13 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 21:53:15 +0000 Subject: [PATCH 28/39] semantic tokesn --- cabal.project | 1 - haskell-language-server.cabal | 71 +++++++ plugins/hls-semantic-tokens-plugin/LICENSE | 201 ------------------ .../hls-semantic-tokens-plugin.cabal | 91 -------- .../hls-semantic-tokens-plugin/test/Main.hs | 2 +- stack-lts21.yaml | 1 - stack.yaml | 1 - 7 files changed, 72 insertions(+), 296 deletions(-) delete mode 100644 plugins/hls-semantic-tokens-plugin/LICENSE delete mode 100644 plugins/hls-semantic-tokens-plugin/hls-semantic-tokens-plugin.cabal diff --git a/cabal.project b/cabal.project index 6710c06936..adf19ed228 100644 --- a/cabal.project +++ b/cabal.project @@ -8,7 +8,6 @@ packages: ./ghcide/test ./hls-plugin-api ./hls-test-utils - ./plugins/hls-semantic-tokens-plugin index-state: 2024-01-21T00:00:00Z diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 0c884b6e44..8de4bb54fb 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1666,6 +1666,77 @@ common semanticTokens build-depends: hls-semantic-tokens-plugin == 2.6.0.0 cpp-options: -Dhls_semanticTokens +library hls-semantic-tokens-plugin + ghc-options: -Wall + buildable: True + exposed-modules: + Ide.Plugin.SemanticTokens + Ide.Plugin.SemanticTokens.Types + Ide.Plugin.SemanticTokens.Mappings + other-modules: + Ide.Plugin.SemanticTokens.Query + Ide.Plugin.SemanticTokens.SemanticConfig + Ide.Plugin.SemanticTokens.Utils + Ide.Plugin.SemanticTokens.Internal + + hs-source-dirs: plugins/hls-semantic-tokens-plugin/src + build-depends: + , aeson + , base >=4.12 && <5 + , containers + , extra + , hiedb + , mtl >= 2.2 + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , lens + , lsp >=2.3 + , sqlite-simple + , text + , unordered-containers + , transformers + , bytestring + , syb + , array + , deepseq + , hls-graph == 2.6.0.0 + , template-haskell + , data-default + + default-language: Haskell2010 + default-extensions: DataKinds + +test-suite hls-semantic-tokens-plugin-tests + type: exitcode-stdio-1.0 + ghc-options: -Wall + default-language: Haskell2010 + hs-source-dirs: plugins/hls-semantic-tokens-plugin/test + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + + build-depends: + , aeson + , base + , containers + , extra + , filepath + , hls-semantic-tokens-plugin + , hls-test-utils == 2.6.0.0 + , ghcide-test-utils + , hls-plugin-api + , lens + , lsp + , ghc + , text-rope + , lsp-test + , text + , data-default + , bytestring + , ghcide == 2.6.0.0 + , hls-plugin-api == 2.6.0.0 + , template-haskell + , data-default + ----------------------------- -- HLS ----------------------------- diff --git a/plugins/hls-semantic-tokens-plugin/LICENSE b/plugins/hls-semantic-tokens-plugin/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/plugins/hls-semantic-tokens-plugin/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/plugins/hls-semantic-tokens-plugin/hls-semantic-tokens-plugin.cabal b/plugins/hls-semantic-tokens-plugin/hls-semantic-tokens-plugin.cabal deleted file mode 100644 index d3cd5ee6fc..0000000000 --- a/plugins/hls-semantic-tokens-plugin/hls-semantic-tokens-plugin.cabal +++ /dev/null @@ -1,91 +0,0 @@ -cabal-version: 2.4 -name: hls-semantic-tokens-plugin -version: 2.6.0.0 -synopsis: Call hierarchy plugin for Haskell Language Server -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: Patrick Wales -maintainer: patrickwalesss@gmail.com -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/*.hs - -source-repository head - type: git - location: https://github.com/haskell/haskell-language-server.git - -library - ghc-options: -Wall - buildable: True - exposed-modules: - Ide.Plugin.SemanticTokens - Ide.Plugin.SemanticTokens.Types - Ide.Plugin.SemanticTokens.Mappings - other-modules: - Ide.Plugin.SemanticTokens.Query - Ide.Plugin.SemanticTokens.SemanticConfig - Ide.Plugin.SemanticTokens.Utils - Ide.Plugin.SemanticTokens.Internal - - hs-source-dirs: src - build-depends: - , aeson - , base >=4.12 && <5 - , containers - , extra - , hiedb - , mtl >= 2.2 - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lens - , lsp >=2.3 - , sqlite-simple - , text - , unordered-containers - , transformers - , bytestring - , syb - , array - , deepseq - , hls-graph == 2.6.0.0 - , template-haskell - , data-default - - default-language: Haskell2010 - default-extensions: DataKinds - -test-suite tests - type: exitcode-stdio-1.0 - ghc-options: -Wall - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - - build-depends: - , aeson - , base - , containers - , extra - , filepath - , hls-semantic-tokens-plugin - , hls-test-utils == 2.6.0.0 - , ghcide-test-utils - , hls-plugin-api - , lens - , lsp - , ghc - , text-rope - , lsp-test - , text - , data-default - , bytestring - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , template-haskell - , data-default diff --git a/plugins/hls-semantic-tokens-plugin/test/Main.hs b/plugins/hls-semantic-tokens-plugin/test/Main.hs index ef8482081a..5174939646 100644 --- a/plugins/hls-semantic-tokens-plugin/test/Main.hs +++ b/plugins/hls-semantic-tokens-plugin/test/Main.hs @@ -48,7 +48,7 @@ import qualified Test.Hls.FileSystem as FS import Test.Hls.FileSystem (file, text) testDataDir :: FilePath -testDataDir = "test" "testdata" +testDataDir = "plugins" "hls-semantic-tokens-plugin" "test" "testdata" mkFs :: [FS.FileTree] -> FS.VirtualFileTree mkFs = FS.mkVirtualFileTree testDataDir diff --git a/stack-lts21.yaml b/stack-lts21.yaml index 4c2a52cf93..4cb4f6f4f5 100644 --- a/stack-lts21.yaml +++ b/stack-lts21.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-semantic-tokens-plugin ghc-options: "$everything": -haddock diff --git a/stack.yaml b/stack.yaml index 81db90f20a..ac6f5df4cf 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,6 @@ packages: - ./hls-plugin-api - ./hls-test-utils # - ./shake-bench - - ./plugins/hls-semantic-tokens-plugin ghc-options: "$everything": -haddock From 45a53df1c968d466663001e7353872d7bb74940b Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 22:01:45 +0000 Subject: [PATCH 29/39] fixup worklows --- .github/workflows/test.yml | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b18504a04..87b5e0b7d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -137,112 +137,112 @@ jobs: - if: matrix.test name: Test hls-refactor-plugin - run: cabal test hls-refactor-plugin --test-options="$TEST_OPTS" || cabal test hls-refactor-plugin --test-options="$TEST_OPTS" + run: cabal test hls-refactor-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-refactor-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-floskell-plugin - run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || cabal test hls-floskell-plugin --test-options="$TEST_OPTS" + run: cabal test hls-floskell-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-floskell-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-class-plugin - run: cabal test hls-class-plugin --test-options="$TEST_OPTS" || cabal test hls-class-plugin --test-options="$TEST_OPTS" + run: cabal test hls-class-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-class-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-pragmas-plugin - run: cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" + run: cabal test hls-pragmas-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-pragmas-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-eval-plugin - run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || cabal test hls-eval-plugin --test-options="$TEST_OPTS" + run: cabal test hls-eval-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-eval-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-splice-plugin - run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || cabal test hls-splice-plugin --test-options="$TEST_OPTS" + run: cabal test hls-splice-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-splice-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test && matrix.ghc != '9.2' name: Test hls-stan-plugin - run: cabal test hls-stan-plugin --test-options="$TEST_OPTS" || cabal test hls-stan-plugin --test-options="$TEST_OPTS" + run: cabal test hls-stan-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-stan-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-stylish-haskell-plugin - run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" + run: cabal test hls-stylish-haskell-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-ormolu-plugin - run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" + run: cabal test hls-ormolu-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-ormolu-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-fourmolu-plugin - run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" + run: cabal test hls-fourmolu-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-explicit-imports-plugin test suite - run: cabal test hls-explicit-imports-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-imports-plugin --test-options="$TEST_OPTS" + run: cabal test hls-explicit-imports-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-explicit-imports-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-call-hierarchy-plugin test suite - run: cabal test hls-call-hierarchy-plugin --test-options="$TEST_OPTS" || cabal test hls-call-hierarchy-plugin --test-options="$TEST_OPTS" + run: cabal test hls-call-hierarchy-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-call-hierarchy-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test && matrix.os != 'windows-latest' name: Test hls-rename-plugin test suite - run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || cabal test hls-rename-plugin --test-options="$TEST_OPTS" + run: cabal test hls-rename-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-rename-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-hlint-plugin test suite - run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin --test-options="$TEST_OPTS" + run: cabal test hls-hlint-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-module-name-plugin test suite - run: cabal test hls-module-name-plugin --test-options="$TEST_OPTS" || cabal test hls-module-name-plugin --test-options="$TEST_OPTS" + run: cabal test hls-module-name-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-module-name-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-alternate-number-format-plugin test suite - run: cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" || cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" + run: cabal test hls-alternate-number-format-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-alternate-number-format-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-qualify-imported-names-plugin test suite - run: cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" || cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" + run: cabal test hls-qualify-imported-names-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-qualify-imported-names-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-code-range-plugin test suite - run: cabal test hls-code-range-plugin --test-options="$TEST_OPTS" || cabal test hls-code-range-plugin --test-options="$TEST_OPTS" + run: cabal test hls-code-range-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-code-range-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-change-type-signature test suite - run: cabal test hls-change-type-signature-plugin --test-options="$TEST_OPTS" || cabal test hls-change-type-signature-plugin --test-options="$TEST_OPTS" + run: cabal test hls-change-type-signature-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-change-type-signature-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-gadt-plugin test suit - run: cabal test hls-gadt-plugin --test-options="$TEST_OPTS" || cabal test hls-gadt-plugin --test-options="$TEST_OPTS" + run: cabal test hls-gadt-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-gadt-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-explicit-fixity-plugin test suite - run: cabal test hls-explicit-fixity-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-fixity-plugin --test-options="$TEST_OPTS" + run: cabal test hls-explicit-fixity-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-explicit-fixity-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-explicit-record-fields-plugin test suite - run: cabal test hls-explicit-record-fields-plugin --test-options="$TEST_OPTS" || cabal test hls-explicit-record-fields-plugin --test-options="$TEST_OPTS" + run: cabal test hls-explicit-record-fields-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-explicit-record-fields-plugin-tests --test-options="$TEST_OPTS" ## version needs to be limited since the tests depend on cabal-fmt which only builds using specific ghc versions - if: matrix.test && matrix.ghc == '9.2' name: Test hls-cabal-fmt-plugin test suite - run: cabal test hls-cabal-fmt-plugin --flag=isolateTests --test-options="$TEST_OPTS" || cabal test hls-cabal-fmt-plugin --flag=isolateTests --test-options="$TEST_OPTS" + run: cabal test hls-cabal-fmt-plugin-tests --flag=isolateTests --test-options="$TEST_OPTS" || cabal test hls-cabal-fmt-plugin-tests --flag=isolateTests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-cabal-plugin test suite - run: cabal test hls-cabal-plugin --test-options="$TEST_OPTS" || cabal test hls-cabal-plugin --test-options="$TEST_OPTS" + run: cabal test hls-cabal-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-cabal-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-retrie-plugin test suite - run: cabal test hls-retrie-plugin --test-options="$TEST_OPTS" || cabal test hls-retrie-plugin --test-options="$TEST_OPTS" + run: cabal test hls-retrie-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-retrie-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-overloaded-record-dot-plugin test suite - run: cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-overloaded-record-dot-plugin --test-options="$TEST_OPTS" + run: cabal test hls-overloaded-record-dot-plugin-tests --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-overloaded-record-dot-plugin-tests --test-options="$TEST_OPTS" - if: matrix.test name: Test hls-semantic-tokens-plugin test suite - run: cabal test hls-semantic-tokens-plugin --test-options="$TEST_OPTS" || cabal test hls-semantic-tokens-plugin --test-options="$TEST_OPTS" + run: cabal test hls-semantic-tokens-plugin-tests --test-options="$TEST_OPTS" || cabal test hls-semantic-tokens-plugin-tests --test-options="$TEST_OPTS" test_post_job: From 99e7cb46cfd08e801a3f8393a88a0d0a93b03f17 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 22:21:11 +0000 Subject: [PATCH 30/39] Rogue cabal fmt plugin cabal file --- .../hls-cabal-fmt-plugin.cabal | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 plugins/hls-cabal-fmt-plugin/hls-cabal-fmt-plugin.cabal diff --git a/plugins/hls-cabal-fmt-plugin/hls-cabal-fmt-plugin.cabal b/plugins/hls-cabal-fmt-plugin/hls-cabal-fmt-plugin.cabal deleted file mode 100644 index 7b2f7219de..0000000000 --- a/plugins/hls-cabal-fmt-plugin/hls-cabal-fmt-plugin.cabal +++ /dev/null @@ -1,61 +0,0 @@ -cabal-version: 2.4 -name: hls-cabal-fmt-plugin -version: 2.6.0.0 -synopsis: Integration with the cabal-fmt code formatter -description: - Please see the README on GitHub at - -license: Apache-2.0 -license-file: LICENSE -author: The Haskell IDE Team -copyright: The Haskell IDE Team -maintainer: jana.chadt@nets.at -category: Development -build-type: Simple -extra-source-files: - LICENSE - test/testdata/**/*.hs - -flag isolateTests - description: Should tests search for 'cabal-fmt' on the $PATH or shall we install it via build-tool-depends? - -- By default, search on the PATH - default: False - manual: True - -common warnings - ghc-options: -Wall -Wunused-packages - -library - import: warnings - exposed-modules: Ide.Plugin.CabalFmt - hs-source-dirs: src - build-depends: - , base >=4.12 && <5 - , directory - , filepath - , ghcide == 2.6.0.0 - , hls-plugin-api == 2.6.0.0 - , lens - , lsp-types - , mtl - , process-extras - , text - - default-language: Haskell2010 - -test-suite tests - import: warnings - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - , base - , directory - , filepath - , hls-cabal-fmt-plugin - , hls-test-utils == 2.6.0.0 - - if flag(isolateTests) - build-tool-depends: cabal-fmt:cabal-fmt ^>=0.1.6 From 3a3473d1b6fc57db05628ad3427d94db0bb7a63d Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 22:32:44 +0000 Subject: [PATCH 31/39] Fix pedantic build --- haskell-language-server.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 8de4bb54fb..4e00424219 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -393,7 +393,7 @@ library hls-eval-plugin , unordered-containers if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=redundant-constraints default-language: Haskell2010 default-extensions: From 276027f6ae9664ac7d533d8b4f2acf320df00d9b Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Wed, 24 Jan 2024 22:39:35 +0000 Subject: [PATCH 32/39] fix extra-source-files globs --- haskell-language-server.cabal | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 4e00424219..283e2f805b 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -23,8 +23,10 @@ extra-source-files: test/testdata/**/*.yaml test/testdata/**/*.hs - plugins/**/test/testdata/*.hs - plugins/**/test/testdata/*.yaml + plugins/**/*.project + plugins/**/*.cabal + plugins/**/*.yaml + plugins/**/*.hs bindist/wrapper.in From 3a7365abea0a0e0a57f2007f96e09ed3ea410afc Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Thu, 25 Jan 2024 09:24:01 +0000 Subject: [PATCH 33/39] Fix test name --- haskell-language-server.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 283e2f805b..7e6bb15747 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1016,7 +1016,7 @@ library hls-qualify-imported-names-plugin DataKinds TypeOperators -test-suite hls-qualify-imported-names-tests +test-suite hls-qualify-imported-names-plugin-tests type: exitcode-stdio-1.0 default-language: Haskell2010 hs-source-dirs: plugins/hls-qualify-imported-names-plugin/test From b48026fd924f987b42b36680b7803a2e518db02b Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Thu, 25 Jan 2024 12:11:15 +0000 Subject: [PATCH 34/39] Remove pointless version constraints --- haskell-language-server.cabal | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 7e6bb15747..ca3ff2030d 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -140,7 +140,7 @@ flag cabal common cabal if flag(cabal) - build-depends: hls-cabal-plugin == 2.6.0.0 + build-depends: hls-cabal-plugin cpp-options: -Dhls_cabal library hls-cabal-plugin @@ -223,7 +223,7 @@ flag class common class if flag(class) - build-depends: hls-class-plugin == 2.6.0.0 + build-depends: hls-class-plugin cpp-options: -Dhls_class library hls-class-plugin @@ -287,7 +287,7 @@ flag callHierarchy common callHierarchy if flag(callHierarchy) - build-depends: hls-call-hierarchy-plugin == 2.6.0.0 + build-depends: hls-call-hierarchy-plugin cpp-options: -Dhls_callHierarchy library hls-call-hierarchy-plugin @@ -348,7 +348,7 @@ flag eval common eval if flag(eval) - build-depends: hls-eval-plugin == 2.6.0.0 + build-depends: hls-eval-plugin cpp-options: -Dhls_eval library hls-eval-plugin @@ -429,7 +429,7 @@ test-suite hls-eval-plugin-tests common importLens if flag(importLens) - build-depends: hls-explicit-imports-plugin == 2.6.0.0 + build-depends: hls-explicit-imports-plugin cpp-options: -Dhls_importLens flag importLens @@ -494,7 +494,7 @@ flag rename common rename if flag(rename) - build-depends: hls-rename-plugin == 2.6.0.0 + build-depends: hls-rename-plugin cpp-options: -Dhls_rename library hls-rename-plugin @@ -550,7 +550,7 @@ flag retrie common retrie if flag(retrie) - build-depends: hls-retrie-plugin == 2.6.0.0 + build-depends: hls-retrie-plugin cpp-options: -Dhls_retrie library hls-retrie-plugin @@ -615,7 +615,7 @@ flag hlint common hlint if flag(hlint) && (impl(ghc < 9.8.0) || flag(ignore-plugins-ghc-bounds)) - build-depends: hls-hlint-plugin == 2.6.0.0 + build-depends: hls-hlint-plugin cpp-options: -Dhls_hlint library hls-hlint-plugin @@ -695,7 +695,7 @@ flag stan common stan if flag(stan) && (impl(ghc > 8.8.1) && impl(ghc <= 9.2.3) || impl(ghc >= 9.4.0) && impl(ghc < 9.10.0)) - build-depends: hls-stan-plugin == 2.6.0.0 + build-depends: hls-stan-plugin cpp-options: -Dhls_stan library hls-stan-plugin @@ -769,7 +769,7 @@ flag moduleName common moduleName if flag(moduleName) - build-depends: hls-module-name-plugin == 2.6.0.0 + build-depends: hls-module-name-plugin cpp-options: -Dhls_moduleName library hls-module-name-plugin @@ -814,7 +814,7 @@ flag pragmas common pragmas if flag(pragmas) - build-depends: hls-pragmas-plugin == 2.6.0.0 + build-depends: hls-pragmas-plugin cpp-options: -Dhls_pragmas library hls-pragmas-plugin @@ -862,7 +862,7 @@ flag splice common splice if flag(splice) - build-depends: hls-splice-plugin == 2.6.0.0 + build-depends: hls-splice-plugin cpp-options: -Dhls_splice library hls-splice-plugin @@ -989,7 +989,7 @@ flag qualifyImportedNames common qualifyImportedNames if flag(qualifyImportedNames) - build-depends: hls-qualify-imported-names-plugin == 2.6.0.0 + build-depends: hls-qualify-imported-names-plugin cpp-options: -Dhls_qualifyImportedNames library hls-qualify-imported-names-plugin @@ -1040,7 +1040,7 @@ flag codeRange common codeRange if flag(codeRange) - build-depends: hls-code-range-plugin == 2.6.0.0 + build-depends: hls-code-range-plugin cpp-options: -Dhls_codeRange library hls-code-range-plugin @@ -1100,7 +1100,7 @@ flag changeTypeSignature common changeTypeSignature if flag(changeTypeSignature) - build-depends: hls-change-type-signature-plugin == 2.6.0.0 + build-depends: hls-change-type-signature-plugin cpp-options: -Dhls_changeTypeSignature library hls-change-type-signature-plugin @@ -1160,7 +1160,7 @@ flag gadt common gadt if flag(gadt) - build-depends: hls-gadt-plugin == 2.6.0.0 + build-depends: hls-gadt-plugin cpp-options: -Dhls_gadt library hls-gadt-plugin @@ -1213,7 +1213,7 @@ flag explicitFixity common explicitFixity if flag(explicitFixity) - build-depends: hls-explicit-fixity-plugin == 2.6.0.0 + build-depends: hls-explicit-fixity-plugin cpp-options: -DexplicitFixity library hls-explicit-fixity-plugin @@ -1260,7 +1260,7 @@ flag explicitFields common explicitFields if flag(explicitFields) - build-depends: hls-explicit-record-fields-plugin == 2.6.0.0 + build-depends: hls-explicit-record-fields-plugin cpp-options: -DexplicitFields library hls-explicit-record-fields-plugin @@ -1309,7 +1309,7 @@ flag overloadedRecordDot common overloadedRecordDot if flag(overloadedRecordDot) - build-depends: hls-overloaded-record-dot-plugin == 2.6.0.0 + build-depends: hls-overloaded-record-dot-plugin cpp-options: -Dhls_overloaded_record_dot library hls-overloaded-record-dot-plugin @@ -1356,7 +1356,7 @@ flag floskell common floskell if flag(floskell) && (impl(ghc < 9.7) || flag(ignore-plugins-ghc-bounds)) - build-depends: hls-floskell-plugin == 2.6.0.0 + build-depends: hls-floskell-plugin cpp-options: -Dhls_floskell library hls-floskell-plugin @@ -1398,7 +1398,7 @@ flag fourmolu common fourmolu if flag(fourmolu) - build-depends: hls-fourmolu-plugin == 2.6.0.0 + build-depends: hls-fourmolu-plugin cpp-options: -Dhls_fourmolu library hls-fourmolu-plugin @@ -1451,7 +1451,7 @@ flag ormolu common ormolu if flag(ormolu) - build-depends: hls-ormolu-plugin == 2.6.0.0 + build-depends: hls-ormolu-plugin cpp-options: -Dhls_ormolu library hls-ormolu-plugin @@ -1504,7 +1504,7 @@ flag stylishHaskell common stylishHaskell if flag(stylishHaskell) && (impl(ghc < 9.8.0) || flag(ignore-plugins-ghc-bounds)) - build-depends: hls-stylish-haskell-plugin == 2.6.0.0 + build-depends: hls-stylish-haskell-plugin cpp-options: -Dhls_stylishHaskell library hls-stylish-haskell-plugin @@ -1549,7 +1549,7 @@ flag refactor common refactor if flag(refactor) - build-depends: hls-refactor-plugin == 2.6.0.0 + build-depends: hls-refactor-plugin cpp-options: -Dhls_refactor library hls-refactor-plugin @@ -1665,7 +1665,7 @@ flag semanticTokens common semanticTokens if flag(semanticTokens) - build-depends: hls-semantic-tokens-plugin == 2.6.0.0 + build-depends: hls-semantic-tokens-plugin cpp-options: -Dhls_semanticTokens library hls-semantic-tokens-plugin From f05ede5f7075263a05d2c8b09fec46055bf0fee0 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Fri, 26 Jan 2024 09:56:14 +0000 Subject: [PATCH 35/39] Try to just exclude windows+9.2 --- .github/workflows/test.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87b5e0b7d2..da786a9593 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,13 +74,18 @@ jobs: - ubuntu-latest - macOS-latest - windows-latest - # Mark which GHC versions on which platforms we want to test. + test: true + exclude: + # Don't test (but do build) on macos, it's sufficiently similar to other OSs + # that it mostly just burns CI time + - os: macos + test: true + # Don't test windows on 9.2, it has particularly bad long-path issues + - os: windows-latest + ghc: "9.2" include: - # Test all supported versions, but only on ubuntu and windows - - os: ubuntu-latest - test: true - - os: windows-latest - test: true + - os: macos + test: false steps: - uses: actions/checkout@v3 From b44215bb442c1f3d6b9a6a2e6c5219edd534cc23 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Fri, 26 Jan 2024 09:57:35 +0000 Subject: [PATCH 36/39] More --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da786a9593..ef46fa1d93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,7 +74,8 @@ jobs: - ubuntu-latest - macOS-latest - windows-latest - test: true + test: + - true exclude: # Don't test (but do build) on macos, it's sufficiently similar to other OSs # that it mostly just burns CI time From 6fe2e112bc888742023300b3a5374e0bf014d93f Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Fri, 26 Jan 2024 09:59:26 +0000 Subject: [PATCH 37/39] More --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef46fa1d93..673567c0a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,7 +79,7 @@ jobs: exclude: # Don't test (but do build) on macos, it's sufficiently similar to other OSs # that it mostly just burns CI time - - os: macos + - os: macOS-latest test: true # Don't test windows on 9.2, it has particularly bad long-path issues - os: windows-latest From 0d12746b98fe29135dd6bb1e551958d6a0f35d3e Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Fri, 26 Jan 2024 09:59:48 +0000 Subject: [PATCH 38/39] More --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 673567c0a8..cf8c9a08a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,7 +85,7 @@ jobs: - os: windows-latest ghc: "9.2" include: - - os: macos + - os: macOS-latest test: false steps: From 7a064d8881dd036910fc45b6548022fd46385bee Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Fri, 26 Jan 2024 11:20:46 +0000 Subject: [PATCH 39/39] more --- .github/workflows/test.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf8c9a08a2..f8619c683b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,16 +76,20 @@ jobs: - windows-latest test: - true + - false exclude: - # Don't test (but do build) on macos, it's sufficiently similar to other OSs - # that it mostly just burns CI time - - os: macOS-latest - test: true - # Don't test windows on 9.2, it has particularly bad long-path issues + # Don't do anything for windows on 9.2, it has particularly bad long-path issues - os: windows-latest ghc: "9.2" - include: + # Exclude the test configuration on macos, it's sufficiently similar to other OSs + # that it mostly just burns CI time. Buiding is still useful since it catches + # solver issues. - os: macOS-latest + test: true + # Exclude the build-only configurations for windows and ubuntu + - os: windows-latest + test: false + - os: ubuntu-latest test: false steps: