Skip to content

Commit

Permalink
fix case control settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dfgordon committed Sep 29, 2024
1 parent 9be418b commit 82334f1
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 28 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: result-${{ matrix.TARGET }}
path: ./artifacts
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: result
pattern: result-*
path: ./artifacts
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.1] - 2024-09-29

### Fixes

* Consistent case control settings in `lang` module

## [3.3.0] - 2024-09-21

### New Features
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "a2kit"
version = "3.3.0"
version = "3.3.1"
edition = "2021"
readme = "README.md"
license = "MIT"
Expand Down
6 changes: 2 additions & 4 deletions src/lang/applesoft/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ impl StatementCompletionProvider {
}
fn modify(&self,s: &str) -> String
{
if let Some(sev) = self.config.flag.case_sensitive {
if self.config.completions.lower_case && sev != lsp::DiagnosticSeverity::ERROR {
return s.to_lowercase();
}
if self.config.flag.case_sensitive.is_none() && self.config.completions.lower_case {
return s.to_lowercase();
}
return s.to_string();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lang/applesoft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This module is used by both the CLI and the language server.
//! The Applesoft parser is provided by `tree_sitter_applesoft`.
//! The server compiles to a separate executable, its entry point is in `src/bin/server-applesoft.rs`.
//! The server compiles to a separate executable, its entry point is in `src/bin/server-applesoft/main.rs`.

mod token_maps;
mod minify_guards;
Expand Down
2 changes: 1 addition & 1 deletion src/lang/applesoft/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn parse(json: &str) -> Result<Settings,DYNERR> {
update_json_bool(val,"keywords",&mut ans.hovers.keywords);
},
"completions" => {
update_json_bool(val,"lowerCaseCompletions",&mut ans.completions.lower_case);
update_json_bool(val,"lowerCase",&mut ans.completions.lower_case);
update_json_bool(val,"negativeAddresses",&mut ans.completions.negative_addresses);
},
"detokenizer" => {
Expand Down
6 changes: 2 additions & 4 deletions src/lang/integer/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,8 @@ impl StatementCompletionProvider {
}
fn modify(&self,s: &str) -> String
{
if let Some(sev) = self.config.flag.case_sensitive {
if self.config.completions.lower_case && sev != lsp::DiagnosticSeverity::ERROR {
return s.to_lowercase();
}
if self.config.flag.case_sensitive.is_none() && self.config.completions.lower_case {
return s.to_lowercase();
}
return s.to_string();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lang/integer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This module is used by both the CLI and the language server.
//! The Integer BASIC parser is provided by `tree_sitter_integerbasic`.
//! The server compiles to a separate executable, its entry point is in `src/bin/server-integerbasic.rs`.
//! The server compiles to a separate executable, its entry point is in `src/bin/server-integerbasic/main.rs`.

mod token_maps;
#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion src/lang/integer/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub fn parse(json: &str) -> Result<Settings,DYNERR> {
update_json_bool(val,"keywords",&mut ans.hovers.keywords);
},
"completions" => {
update_json_bool(val,"lowerCaseCompletions",&mut ans.completions.lower_case);
update_json_bool(val,"lowerCase",&mut ans.completions.lower_case);
},
"detokenizer" => {
update_json_i64(val, "maxLineLength", &mut ans.detokenizer.max_line_length);
Expand Down
6 changes: 2 additions & 4 deletions src/lang/merlin/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,8 @@ impl CodeCompletionProvider {
self.symbols = sym;
}
fn modify(&self,s: &str,padreq: usize) -> String {
if let Some(sev) = self.config.flag.case_sensitive {
if self.config.completions.lower_case && sev != lsp::DiagnosticSeverity::ERROR {
return [" ".repeat(padreq), s.to_lowercase()].concat();
}
if self.config.flag.case_sensitive.is_none() && self.config.completions.lower_case {
return [" ".repeat(padreq), s.to_lowercase()].concat();
}
return [" ".repeat(padreq), s.to_uppercase()].concat();
}
Expand Down
2 changes: 1 addition & 1 deletion src/lang/merlin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This module is used by both the CLI and the language server.
//! The Merlin parser is provided by `tree_sitter_merlin6502`. Every file will be parsed as Merlin 16+,
//! other Merlin versions are handled via diagnostic filters.
//! The server compiles to a separate executable, its entry point is in `src/bin/server-merlin.rs`.
//! The server compiles to a separate executable, its entry point is in `src/bin/server-merlin/main.rs`.
//!
//! The analyzer performs functions that begin to resemble assembly, such as resolving
//! file relationships and identifying symbols. There is a spot assembler that is used to aid in
Expand Down

0 comments on commit 82334f1

Please sign in to comment.