Skip to content

Commit 7b6efe8

Browse files
authored
Merge pull request #285 from bubba/fix-dud-rename-provider
Fix rename capability being declared
2 parents b15508a + 9c3037b commit 7b6efe8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Ide/Plugin.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ asGhcIdePlugin mp =
7272
ls = Map.toList (ipMap mp)
7373

7474
mkPlugin :: ([(PluginId, b)] -> Plugin Config) -> (PluginDescriptor -> Maybe b) -> Plugin Config
75-
mkPlugin maker selector
76-
= maker $ concatMap (\(pid, p) -> justs (pid, selector p)) ls
75+
mkPlugin maker selector =
76+
case concatMap (\(pid, p) -> justs (pid, selector p)) ls of
77+
-- If there are no plugins that provide a descriptor, use mempty to
78+
-- create the plugin – otherwise we we end up declaring handlers for
79+
-- capabilities that there are no plugins for
80+
[] -> mempty
81+
xs -> maker xs
7782

7883

7984
pluginDescToIdePlugins :: [PluginDescriptor] -> IdePlugins

0 commit comments

Comments
 (0)