mui-lsp 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/mui/lsp/plugin.rb +43 -13
- data/lib/mui/lsp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 990948dead05098d8add9c4fc12c55470b8361fcafc8ca8de025be882f81d0b8
|
|
4
|
+
data.tar.gz: 89e3a3c9c0bc688342fcfde30576b94d186ec1207a178af279eed1df73cd1076
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05e02edfd2e6658e488d7b9b7f04dd97f9ec08aec3d7025ece92913a67e7a4ecb8dd7270b5cc2dc1e91622fb878e12b61452b150dcce3d78c61bd3c6f8130672
|
|
7
|
+
data.tar.gz: 2ba900393380934caa9392790791b19910ba2078db4e5a3a8851a8c64d983e12eb5acf1b18e3093c3aadfaa17777fd35f1b95c9741e24f79a467d35f50fa0808
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.1] - 2025-12-11
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- `Mui::Lsp::ConfigDsl` now imports configurations from `Mui::LspConfigStub`:
|
|
8
|
+
- Allows `Mui.lsp { ... }` to be called in `.muirc` before mui-lsp gem is loaded
|
|
9
|
+
- Configurations stored in the stub are automatically migrated when the gem loads
|
|
10
|
+
- Requires Mui v0.2.0+ which provides `LspConfigStub`
|
|
11
|
+
|
|
3
12
|
## [0.1.0] - 2025-12-11
|
|
4
13
|
|
|
5
14
|
### Added
|
data/lib/mui/lsp/plugin.rb
CHANGED
|
@@ -485,26 +485,17 @@ end
|
|
|
485
485
|
Mui.plugin_manager.register(:lsp, Mui::Lsp::Plugin)
|
|
486
486
|
|
|
487
487
|
# DSL for .muirc configuration
|
|
488
|
+
# This replaces Mui.lsp stub method from mui core with the real implementation
|
|
488
489
|
module Mui
|
|
489
|
-
class << self
|
|
490
|
-
def lsp(&block)
|
|
491
|
-
@lsp_config ||= Lsp::ConfigDsl.new
|
|
492
|
-
@lsp_config.instance_eval(&block) if block
|
|
493
|
-
@lsp_config
|
|
494
|
-
end
|
|
495
|
-
|
|
496
|
-
def lsp_server_configs
|
|
497
|
-
@lsp_config&.server_configs || []
|
|
498
|
-
end
|
|
499
|
-
end
|
|
500
|
-
|
|
501
490
|
module Lsp
|
|
502
491
|
# DSL class for configuring LSP in .muirc
|
|
503
492
|
class ConfigDsl
|
|
504
493
|
attr_reader :server_configs
|
|
505
494
|
|
|
506
|
-
def initialize
|
|
495
|
+
def initialize(existing_configs = [])
|
|
507
496
|
@server_configs = []
|
|
497
|
+
# Import configs from LspConfigStub if any were defined before gem load
|
|
498
|
+
import_stub_configs(existing_configs)
|
|
508
499
|
end
|
|
509
500
|
|
|
510
501
|
def use(name, sync_on_change: nil)
|
|
@@ -534,6 +525,45 @@ module Mui
|
|
|
534
525
|
sync_on_change: sync_on_change
|
|
535
526
|
)
|
|
536
527
|
end
|
|
528
|
+
|
|
529
|
+
private
|
|
530
|
+
|
|
531
|
+
def import_stub_configs(configs)
|
|
532
|
+
configs.each do |cfg|
|
|
533
|
+
case cfg[:type]
|
|
534
|
+
when :preset
|
|
535
|
+
use(cfg[:name], **cfg.fetch(:options, {}))
|
|
536
|
+
when :custom
|
|
537
|
+
server(
|
|
538
|
+
name: cfg[:name],
|
|
539
|
+
command: cfg[:command],
|
|
540
|
+
language_ids: cfg[:language_ids],
|
|
541
|
+
file_patterns: cfg[:file_patterns],
|
|
542
|
+
auto_start: cfg.fetch(:auto_start, true),
|
|
543
|
+
sync_on_change: cfg.fetch(:sync_on_change, true)
|
|
544
|
+
)
|
|
545
|
+
end
|
|
546
|
+
end
|
|
547
|
+
end
|
|
548
|
+
end
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
class << self
|
|
552
|
+
def lsp(&block)
|
|
553
|
+
# Migrate from LspConfigStub to real ConfigDsl on first access after gem load
|
|
554
|
+
if @lsp_config.is_a?(LspConfigStub)
|
|
555
|
+
existing_configs = @lsp_config.server_configs
|
|
556
|
+
@lsp_config = Lsp::ConfigDsl.new(existing_configs)
|
|
557
|
+
end
|
|
558
|
+
@lsp_config ||= Lsp::ConfigDsl.new
|
|
559
|
+
@lsp_config.instance_eval(&block) if block
|
|
560
|
+
@lsp_config
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
def lsp_server_configs
|
|
564
|
+
# Ensure migration happens
|
|
565
|
+
lsp unless @lsp_config.is_a?(Lsp::ConfigDsl)
|
|
566
|
+
@lsp_config&.server_configs || []
|
|
537
567
|
end
|
|
538
568
|
end
|
|
539
569
|
end
|
data/lib/mui/lsp/version.rb
CHANGED