Skip to content

Commit

Permalink
Fix comping regex to support Kotlin escapes
Browse files Browse the repository at this point in the history
Fixes gh-26
  • Loading branch information
philwebb committed Jan 31, 2025
1 parent d1fa17b commit e39ff72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/code-chomping-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const JAVA_LIKE = ['groovy', 'java', 'kotlin']
const ChompDirRx = /\/\/ @chomp:(file|line)$/
const ChompAndReplaceDirRx = /^(.+?)\/\*(?: @chomp:line (.+?) )?\*\/ ?\S/
const FormatterDirRx = /\/\/ @formatter:(?:on|off)$/
const PackageDeclRx = /^package (?:[a-z][a-z0-9]*(?:[.][a-z][a-z0-9]*)*)(;|)$/
const PackageDeclRx = /^package (?:[a-z`][a-z0-9`]*(?:[.][a-z`][a-z0-9`]*)*)(;|)$/
const SuppressAnnotRx = /@Suppress(?:Warnings)?\(.+?\)$/

function register (registry) {
Expand Down
2 changes: 1 addition & 1 deletion test/code-chomping-extension-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('code-chomping-extension', () => {
* Copyright 2000-present ACME Corp. Free the source!
*/
package org.example
package org.example.\`object\`
public class Example {}
`
Expand Down

0 comments on commit e39ff72

Please # to comment.