File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file.
66The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
77and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
88
9+ ## [ 1.4.2] - 2023-12-09
10+
11+ ### Fixed
12+
13+ - Made the ` mod ` snippet handle the case where the module declaration already
14+ exists.
15+ Thanks [ @gregorias ] ( https://github.com/gregorias ) !
16+
917## [ 1.4.1] - 2023-12-05
1018
1119### Fixed
Original file line number Diff line number Diff line change @@ -73,7 +73,11 @@ local get_clients = vim.lsp.get_clients or vim.lsp.get_active_clients
7373function util .lsp_get_module_name ()
7474 if # get_clients { bufnr = 0 } > 0 then
7575 for _ , lens in pairs (vim .lsp .codelens .get (0 )) do
76- local name = lens .command .title :match (' module (.*) where' )
76+ -- Strings to match taken from the module name plugin:
77+ -- https://github.com/haskell/haskell-language-server/blob/f0c16469046bd554828ea057b5e1f047ad02348e/plugins/hls-module-name-plugin/src/Ide/Plugin/ModuleName.hs#L129-L136
78+ local name_module_decl_absent = lens .command .title :match (' module (.*) where' )
79+ local name_module_decl_present = lens .command .title :match (' Set module name to (.*)' )
80+ local name = name_module_decl_absent or name_module_decl_present
7781 if name then
7882 return name
7983 end
You can’t perform that action at this time.
0 commit comments