Skip to content

Commit

Permalink
Allow spaces and periods in instance names
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Aug 18, 2024
1 parent 7a735a8 commit af59982
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed

- Fixed spaces and periods in instance names not being allowed for insert & rename operations.

## `0.3.3` - July 24th, 2024

### Added
Expand Down
4 changes: 2 additions & 2 deletions editors/vscode/src/providers/insertInstance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class InsertInstanceProvider implements vscode.Disposable {
if (this.currentWorkspacePath && this.currentInstance) {
if (hasDisallowedCharacter(this.input.value)) {
this.input.validationMessage =
"Name must only contain alphanumeric characters, underscores, and dashes"
'Name must only contain alphanumeric characters, or one of the following characters: ".", "_", "-", " "'
} else {
this.input.validationMessage = undefined
}
Expand Down Expand Up @@ -226,5 +226,5 @@ export class InsertInstanceProvider implements vscode.Disposable {
}

const hasDisallowedCharacter = (s: string): boolean => {
return /[^a-zA-Z0-9_-]/.test(s)
return /[^a-zA-Z0-9_. -]/.test(s)
}
4 changes: 2 additions & 2 deletions editors/vscode/src/providers/renameInstance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class RenameInstanceProvider implements vscode.Disposable {
if (this.currentWorkspacePath && this.currentInstance) {
if (hasDisallowedCharacter(this.input.value)) {
this.input.validationMessage =
"Name must only contain alphanumeric characters, underscores, and dashes"
'Name must only contain alphanumeric characters, or one of the following characters: ".", "_", "-", " "'
} else {
this.input.validationMessage = undefined
}
Expand Down Expand Up @@ -86,5 +86,5 @@ export class RenameInstanceProvider implements vscode.Disposable {
}

const hasDisallowedCharacter = (s: string): boolean => {
return /[^a-zA-Z0-9_-]/.test(s)
return /[^a-zA-Z0-9_. -]/.test(s)
}

0 comments on commit af59982

Please sign in to comment.