Don't apply hlint to source code generated by ghc plugins
Steps to reproduce
- Clone https://github.com/codygman/hls-hlints-source-plugin-generated-code/blob/2c170e5b5f446fb3362d967db3fe8a87fe2c7215/src/Main.hs#L8
- Go to line 8: ToJSON
- let hls finish loading up
Expected behaviour
Source code generated by the evoke source plugin or other source plugins has hlint and any custom hlint rules applied to it that aren't relevant to your codebase.
Actual behaviour
You'll see a squiggle for the "use into" rule because the generated code uses Text.pack internally.
Actually, the project linked is crashing using haskell-language-server 1.5.1,stack 2.7.3, and ghc 8.10.7 from NixOS.
error log
Found "/home/cody/hls-hlints-source-plugin-generated-code/hie.yaml" for "/home/cody/hls-hlints-source-plugin-generated-code/a"
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /home/cody/hls-hlints-source-plugin-generated-code
Operating system: linux
Arguments: ["--lsp","-d","-l","/tmp/hls.log"]
Cradle directory: /home/cody/hls-hlints-source-plugin-generated-code
Cradle type: Stack
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /nix/store/xxbjg2v8g4csvpjjd52yld6ly234asc1-haskell-language-server-1.5.1.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /home/cody/hls-hlints-source-plugin-generated-code
haskell-language-server-wrapper: callProcess: /run/current-system/sw/bin/haskell-language-server-8.10.7 "--lsp" "-d" "-l" "/tmp/hls.log" (exit -11): failed
Process lsp-haskell stderr finished
Found "/home/cody/hls-hlints-source-plugin-generated-code/hie.yaml" for "/home/cody/hls-hlints-source-plugin-generated-code/a"
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /home/cody/hls-hlints-source-plugin-generated-code
Operating system: linux
Arguments: ["--lsp","-d","-l","/tmp/hls.log"]
Cradle directory: /home/cody/hls-hlints-source-plugin-generated-code
Cradle type: Stack
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /nix/store/xxbjg2v8g4csvpjjd52yld6ly234asc1-haskell-language-server-1.5.1.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /home/cody/hls-hlints-source-plugin-generated-code
haskell-language-server-wrapper: callProcess: /run/current-system/sw/bin/haskell-language-server-8.10.7 "--lsp" "-d" "-l" "/tmp/hls.log" (exit -11): failed
Process lsp-haskell stderr finished
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Operating system: linux
Arguments: ["--lsp","-d","-l","/tmp/hls.log"]
Cradle directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Cradle type: Cabal
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /nix/store/xxbjg2v8g4csvpjjd52yld6ly234asc1-haskell-language-server-1.5.1.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Process lsp-haskell stderr finished
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Operating system: linux
Arguments: ["--lsp","-d","-l","/tmp/hls.log"]
Cradle directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Cradle type: Cabal
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /nix/store/xxbjg2v8g4csvpjjd52yld6ly234asc1-haskell-language-server-1.5.1.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Process lsp-haskell stderr finished
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Operating system: linux
Arguments: ["--lsp","-d","-l","/tmp/hls.log"]
Cradle directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Cradle type: Cabal
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /nix/store/xxbjg2v8g4csvpjjd52yld6ly234asc1-haskell-language-server-1.5.1.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /home/cody/hls-hlints-source-plugin-generated-code-cabal
Found "/home/cody/hls-hlints-source-plugin-generated-code/hie.yaml" for "/home/cody/hls-hlints-source-plugin-generated-code/a"
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /home/cody/hls-hlints-source-plugin-generated-code
Operating system: linux
Arguments: ["--lsp","-d","-l","/tmp/hls.log"]
Cradle directory: /home/cody/hls-hlints-source-plugin-generated-code
Cradle type: Stack
Tool versions found on the $PATH
cabal: 3.6.2.0
stack: 2.7.3
ghc: 8.10.7
Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /nix/store/xxbjg2v8g4csvpjjd52yld6ly234asc1-haskell-language-server-1.5.1.0/bin/haskell-language-server)
Starting (haskell-language-server)LSP server...
with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "/tmp/hls.log", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
in directory: /home/cody/hls-hlints-source-plugin-generated-code
haskell-language-server-wrapper: callProcess: /run/current-system/sw/bin/haskell-language-server-8.10.7 "--lsp" "-d" "-l" "/tmp/hls.log" (exit -11): failed
Process lsp-haskell stderr<1> finished
debug log
2022-01-07 18:00:28.173079372 [ThreadId 4] INFO hls: Starting LSP server...
2022-01-07 18:00:28.173197723 [ThreadId 4] INFO hls: If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option!
2022-01-07 18:00:28.174100645 [ThreadId 13] INFO hls: Started LSP server in 0.00s
2022-01-07 18:00:28.177599955 [ThreadId 13] DEBUG hls: setInitialDynFlags cradle: Cradle {cradleRootDir = "/home/cody/hls-hlints-source-plugin-generated-code", cradleOptsProg = CradleAction: Stack}
2022-01-07 18:00:30.774742574 [ThreadId 13] DEBUG hls: runSubset: True
2022-01-07 18:00:30.774838915 [ThreadId 21] DEBUG hls: Initializing exports map from hiedb
2022-01-07 18:00:30.775012965 [ThreadId 13] INFO hls: Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-6506281161209482381) "file:///home/cody/hls-hlints-source-plugin-generated-code"], clientSettings = hashed Nothing}
2022-01-07 18:00:30.776187788 [ThreadId 21] DEBUG hls: Done initializing exports map from hiedb (1)
2022-01-07 18:00:30.777095771 [ThreadId 23] DEBUG hls: Configuration changed: Object (fromList [("haskell",Object (fromList [("checkProject",Bool True),("formattingProvider",String "ormolu"),("maxCompletions",Number 40.0),("plugin",Object (fromList [("class",Object (fromList [("globalOn",Bool True)])),("eval",Object (fromList [("globalOn",Bool True)])),("ghcide-completions",Object (fromList [("config",Object (fromList [("autoExtendOn",Bool True),("snippetsOn",Bool True)]))])),("ghcide-type-lenses",Object (fromList [("config",Object (fromList [("mode",Bool True)])),("globalOn",Bool True)])),("haddockComments",Object (fromList [("globalOn",Bool True)])),("hlint",Object (fromList [("codeActionsOn",Bool True),("diagnosticsOn",Bool True)])),("importLens",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True)])),("moduleName",Object (fromList [("globalOn",Bool True)])),("pragmas",Object (fromList [("codeActionsOn",Bool True),("completionOn",Bool True)])),("refineImports",Object (fromList [("globalOn",Bool True)])),("retrie",Object (fromList [("globalOn",Bool True)])),("splice",Object (fromList [("globalOn",Bool True)])),("tactics",Object (fromList [("config",Object (fromList [("auto_gas",Number 4.0),("max_use_ctor_actions",Number 5.0),("proofstate_styling",Bool True),("timeout_duration",Number 2.0)])),("globalOn",Bool True)]))]))]))])
2022-01-07 18:00:30.777317982 [ThreadId 26] DEBUG hls: Finishing build session(exception: AsyncCancelled)
2022-01-07 18:00:30.777323412 [ThreadId 23] DEBUG hls: Restarting build session due to config change with queue [] for keys [GetClientSettings; ] (aborting the previous one took 0.00s)
2022-01-07 18:00:30.778004104 [ThreadId 23] DEBUG hls: Set files of interest to: fromList [(NormalizedFilePath "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs",Modified {firstOpen = True})]
2022-01-07 18:00:30.778111374 [ThreadId 41] DEBUG hls: Finishing build session(exception: AsyncCancelled)
2022-01-07 18:00:30.778113244 [ThreadId 23] DEBUG hls: Restarting build session due to /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs (modified) with queue [] for keys [IsFileOfInterest; /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs,GetModificationTime; /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs,GetClientSettings; ] (aborting the previous one took 0.00s)
2022-01-07 18:00:30.778190204 [ThreadId 23] DEBUG hls: Opened text document: file:///home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs
2022-01-07 18:00:30.778396255 [ThreadId 76] DEBUG hls: src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:30.778522165 [ThreadId 66] DEBUG hls: hlint:getIdeas:file:NormalizedFilePath "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:30.778703946 [ThreadId 82] INFO hls: Consulting the cradle for "src/Main.hs"
2022-01-07 18:00:30.778947816 [ThreadId 101] DEBUG hls: Output from setting up the cradle Cradle {cradleRootDir = "/home/cody/hls-hlints-source-plugin-generated-code", cradleOptsProg = CradleAction: Stack}
2022-01-07 18:00:30.789084465 [ThreadId 139] DEBUG hls: DocumentHighlight request at position 15:1 in file: /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs
2022-01-07 18:00:30.789211495 [ThreadId 139] DEBUG hls: LOOKUP UP PERSISTENT FOR: GetHieAst
2022-01-07 18:00:30.789652447 [ThreadId 146] DEBUG hls: src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:30.791081501 [ThreadId 161] DEBUG hls: src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:32.143076427 [ThreadId 104] INFO hie-bios: Using main module: 1. Package `hls-hlints-source-plugin-generated-code' component hls-hlints-source-plugin-generated-code:exe:hls-hlints-source-plugin-generated-code with main-is file: /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs
2022-01-07 18:00:32.304259166 [ThreadId 104] INFO hie-bios: Configuring GHCi with the following packages: hls-hlints-source-plugin-generated-code
2022-01-07 18:00:33.751311039 [ThreadId 177] INFO hie-bios: /home/cody/hls-hlints-source-plugin-generated-code/.stack-work/install/x86_64-linux-nix/2dab9d0a2b6e80bb0755113a4073c95149e8ca9149e4fb3d7cee1e6c045363a9/8.10.7/pkgdb:/home/cody/.stack/snapshots/x86_64-linux-nix/2dab9d0a2b6e80bb0755113a4073c95149e8ca9149e4fb3d7cee1e6c045363a9/8.10.7/pkgdb:/nix/store/c588pxhnjqqlp5iarbwxcvvrpb14z1wb-ghc-8.10.7/lib/ghc-8.10.7/package.conf.d
2022-01-07 18:00:36.308801858 [ThreadId 82] DEBUG hls: Session loading result: Right (ComponentOptions {componentOptions = ["-i","-odir=/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/odir","-hidir=/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/odir","-hide-all-packages","-i/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/dist/x86_64-linux-nix/Cabal-3.2.1.0/build/hls-hlints-source-plugin-generated-code","-i/home/cody/hls-hlints-source-plugin-generated-code/src","-i/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/dist/x86_64-linux-nix/Cabal-3.2.1.0/build/hls-hlints-source-plugin-generated-code/autogen","-i/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/dist/x86_64-linux-nix/Cabal-3.2.1.0/build/global-autogen","-i/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/dist/x86_64-linux-nix/Cabal-3.2.1.0/build/hls-hlints-source-plugin-generated-code/hls-hlints-source-plugin-generated-code-tmp","-stubdir=/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/dist/x86_64-linux-nix/Cabal-3.2.1.0/build","-I/nix/store/c588pxhnjqqlp5iarbwxcvvrpb14z1wb-ghc-8.10.7/include","-I/nix/store/cpx9hzqcxci468qjwx1yk9k8rwmhlqxl-git-2.31.1/include","-I/nix/store/88ghxafjpqp5sqpd75r51qqg4q5d95ss-gcc-wrapper-10.3.0/include","-I/nix/store/s1ycqf4d7lyzpjd9mc6ny7704ga8cih6-gmp-6.2.1-dev/include","-L/nix/store/c588pxhnjqqlp5iarbwxcvvrpb14z1wb-ghc-8.10.7/lib","-L/nix/store/cpx9hzqcxci468qjwx1yk9k8rwmhlqxl-git-2.31.1/lib","-L/nix/store/88ghxafjpqp5sqpd75r51qqg4q5d95ss-gcc-wrapper-10.3.0/lib","-L/nix/store/90n0kdhgxhcig5imd3m44kcxdwz6903c-gmp-6.2.1/lib","-package-id=base-4.14.3.0","-package-id=aeson-1.5.6.0-DkwLMaMFAoKEbTeMR8x6ex","-package-id=Cabal-3.2.1.0","-package-id=evoke-0.2021.9.14-CjamQ5Z6yuv42x5MmHWhS","-package-id=text-1.2.4.1","-package-id=witch-0.3.4.2-ET3UOQvZiQaARfjTrpeMrM","-optP-include","-optP/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/ghci/32aeb0d5/cabal_macros.h","-ghci-script=/run/user/1000/haskell-stack-ghci/1960ae58/ghci-script","-package-db","/home/cody/hls-hlints-source-plugin-generated-code/.stack-work/install/x86_64-linux-nix/2dab9d0a2b6e80bb0755113a4073c95149e8ca9149e4fb3d7cee1e6c045363a9/8.10.7/pkgdb","-package-db","/home/cody/.stack/snapshots/x86_64-linux-nix/2dab9d0a2b6e80bb0755113a4073c95149e8ca9149e4fb3d7cee1e6c045363a9/8.10.7/pkgdb","-package-db","/nix/store/c588pxhnjqqlp5iarbwxcvvrpb14z1wb-ghc-8.10.7/lib/ghc-8.10.7/package.conf.d"], componentRoot = "/home/cody/hls-hlints-source-plugin-generated-code", componentDependencies = ["hls-hlints-source-plugin-generated-code.cabal","package.yaml","stack.yaml"]},"/nix/store/c588pxhnjqqlp5iarbwxcvvrpb14z1wb-ghc-8.10.7/lib/ghc-8.10.7")
2022-01-07 18:00:36.344483919 [ThreadId 82] INFO hls: Using interface files cache dir: /home/cody/.cache/ghcide/main-e1ca8362ea6c178163ea17e34ec6e90a6f4f9d63
2022-01-07 18:00:36.344639 [ThreadId 82] INFO hls: Making new HscEnv[main]
2022-01-07 18:00:36.349582544 [ThreadId 82] DEBUG hls: New Component Cache HscEnvEq: (([],Just HscEnvEq 35),fromList [("/home/cody/hls-hlints-source-plugin-generated-code/hie.yaml",Just 2022-01-07 20:08:31.140194762 UTC),("hls-hlints-source-plugin-generated-code.cabal",Just 2022-01-07 20:39:14.161280193 UTC),("package.yaml",Nothing),("stack.yaml",Just 2022-01-07 19:58:30.735244361 UTC)])
2022-01-07 18:00:36.349778614 [ThreadId 82] DEBUG hls: Known files updated: fromList [(TargetFile NormalizedFilePath "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs",fromList ["/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"])]
2022-01-07 18:00:36.350050385 [ThreadId 56] DEBUG hls: Finishing build session(exception: AsyncCancelled)
2022-01-07 18:00:36.350041435 [ThreadId 82] DEBUG hls: Restarting build session due to new component with queue ["ModuleName.ghcSession","RefineImports","Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps","eval.GetParsedModuleWithComments","Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps","","eval.GetParsedModuleWithComments","codeLens.TypeCheck","retrie","RefineImports","GhcideCodeActions.getParsedModule","splice.codeAction.GitHieAst","","codeLens.TypeCheck","C:GetHieAst:/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs","Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps","ModuleName.ghcSession","Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps","RefineImports","","importLens","Pragmas.GetParsedModule","HaddockComments.GetAnnotatedParsedSource","Outline","ModuleName.ghcSession","RefineImports","eval.GetParsedModuleWithComments","codeLens.TypeCheck"] for keys [GetKnownTargets; ,IsFileOfInterest; /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs,GetModificationTime; /home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs,GhcSessionIO; ] (aborting the previous one took 0.00s)
2022-01-07 18:00:36.350429786 [ThreadId 204] DEBUG hls: hlint:getIdeas:file:NormalizedFilePath "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:36.351501719 [ThreadId 255] INFO hls: finish: ModuleName.ghcSession (took 0.00s)
2022-01-07 18:00:36.351487999 [ThreadId 197] INFO hls: finish: ModuleName.ghcSession (took 0.00s)
2022-01-07 18:00:36.351508909 [ThreadId 237] INFO hls: finish: ModuleName.ghcSession (took 0.00s)
2022-01-07 18:00:36.352157561 [ThreadId 309] DEBUG hls: src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:36.352346902 [ThreadId 319] INFO hls: finish: ModuleName.ghcSession (took 0.00s)
2022-01-07 18:00:36.352455202 [ThreadId 324] DEBUG hls: src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:36.352669093 [ThreadId 334] INFO hls: finish: ModuleName.ghcSession (took 0.00s)
2022-01-07 18:00:36.352783713 [ThreadId 340] DEBUG hls: src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/home/cody/hls-hlints-source-plugin-generated-code/src/Main.hs"
2022-01-07 18:00:36.352989943 [ThreadId 351] INFO hls: finish: ModuleName.ghcSession (took 0.00s)
Then if I use cabal this weird behavior happens where applying the code suggestion actually inserts the code generated by the source plugin.
See the suggestion:

Then after applying the code action:

This is difficult to do this as hlint has no way to know which parts of the parsed source are generated.