-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 'fix: consider the length of the ReferenceToken te…
…xt' from fix/formatter into develop Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/api.onlyoffice.com/pulls/114 Reviewed-by: Ivan Uhalin <[email protected]>
- Loading branch information
Showing
4 changed files
with
223 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
interface FirstInterface {} | ||
interface SecondInterface {} | ||
interface ThirdInterface {} | ||
interface FourthInterface {} | ||
interface FifthInterface {} | ||
interface SixthInterface {} | ||
|
||
interface I { | ||
p0: | ||
| FirstInterface | ||
| SecondInterface | ||
| ThirdInterface | ||
| FourthInterface | ||
| FifthInterface | ||
| SixthInterface | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
import { DeclarationEntity } from "@onlyoffice/library-declaration/next.js" | ||
import { | ||
EntityToken, | ||
KeywordToken, | ||
ParameterToken, | ||
Reference, | ||
type Signature, | ||
TextToken, | ||
type Token, | ||
TypeToken, | ||
} from "@onlyoffice/signature" | ||
|
||
export const name = "computing the signature for an interface with a parameter with a string length of more than 100 characters and whose types are Reference" | ||
export const collection: DeclarationEntity[] = [] | ||
|
||
const e0 = new DeclarationEntity() | ||
let s: Signature = [] | ||
let t: Token | Reference | ||
|
||
e0.id = 5 | ||
|
||
t = new KeywordToken() | ||
t.text = "interface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new EntityToken() | ||
t.text = "I" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "{" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new ParameterToken() | ||
t.text = "p0" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = ": " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "3" | ||
t.token = new TypeToken() | ||
t.token.text = "FirstInterface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " | " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "8" | ||
t.token = new TypeToken() | ||
t.token.text = "SecondInterface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " | " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "10" | ||
t.token = new TypeToken() | ||
t.token.text = "ThirdInterface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " | " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "4" | ||
t.token = new TypeToken() | ||
t.token.text = "FourthInterface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " | " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "2" | ||
t.token = new TypeToken() | ||
t.token.text = "FifthInterface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " | " | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "9" | ||
t.token = new TypeToken() | ||
t.token.text = "SixthInterface" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "\n" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "" | ||
s.push(t) | ||
|
||
t = new TextToken() | ||
t.text = "}" | ||
s.push(t) | ||
|
||
e0.declaration.signature.verbose.push(...s) | ||
s = [] | ||
|
||
t = new TextToken() | ||
t.text = " " | ||
s.push(t) | ||
|
||
t = new Reference() | ||
t.id = "5" | ||
t.token = new TypeToken() | ||
t.token.text = "I" | ||
s.push(t) | ||
|
||
e0.declaration.signature.concise.push(...s) | ||
s = [] | ||
|
||
collection.push(e0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"exclude": ["test.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters