This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 375
feat: Language-Understanding LSP #1711
Merged
Merged
Changes from 84 commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
a3be983
Add LSP of LG
967c133
change folder name
50eead9
change folder location
9e4da28
seperate server and client demo
1963f3a
add completion and hover for builtin-functions
4ed777e
change file names
ba5b6d4
change dependency
c58ae8c
refactor the package
85a2523
update demo readme
415a11c
merge changes from master
934211d
make some refine
Danieladu e825a94
Merge branch 'master' into shuwan/AddingLG_LSP
Danieladu 6699260
remove npm lock file
Danieladu 2a3957b
Merge branch 'master' into shuwan/AddingLG_LSP
f4dd101
add demos to workspace and run test in 1 command
4e34574
remove declaration files
615266e
change tsc outDir to dist, simplify test command
b24276c
Merge branch 'master' into shuwan/AddingLG_LSP
boydc2014 7a792ed
add syntax highlight in demo and new API
70729c3
Merge branch 'shuwan/AddingLG_LSP' of https://github.com/microsoft/Bo…
79264f0
change naming of the project and move the demo
e0927c6
merge from master and resolve confilcts
3e35a12
remove package.json in demo
1ec29ec
Merge branch 'shuwan/AddingLG_LSP' of https://github.com/microsoft/Bo…
ed2a6d7
change the content in readme
d3eea2d
fix lg-lsp package publish problem
e368b33
fix build command and redundent d.ts files
f4e384d
integrate LG LSP server to composer server
0fda7c6
change api in demo
f8d78a2
Merge branch 'master' into shuwan/AddingLG_LSP
a8835be
Merge branch 'master' into shuwan/AddingLG_LSP
boydc2014 862ddc8
Merge branch 'master' into shuwan/AddingLG_LSP
f561ee1
change the order of commands in build:prod
67726d1
Merge branch 'shuwan/AddingLG_LSP' of https://github.com/microsoft/Bo…
5d58244
delete redundent files generated from build
6f03b83
change lg-lsp-server api to attachLSPServer
98bb820
remove gitignore in lg-lsp-server demo
26d6ae0
Merge branch 'master' into shuwan/AddingLG_LSP
57a7e47
Merge branch 'master' into shuwan/AddingLG_LSP
54662d7
remove attachLSPServer in server
ebc3218
Merge branch 'master' into shuwan/AddingLG_LSP
9e36bd3
Merge branch 'master' into shuwan/AddingLG_LSP
zhixzhan f4732c2
Merge branch 'master' into shuwan/AddingLG_LSP
zhixzhan 96739a5
Merge branch 'master' into shuwan/AddingLG_LSP
78a3529
fix token rules and suggestion context awareness
31753fa
Merge branch 'master' into shuwan/AddingLG_LSP
9575102
Merge branch 'master' into shuwan/AddingLG_LSP
474511f
init of LU LSP
352a703
add diagnostic in LSP
413132f
add auto suggestions
b0f74c3
fix
512ca2c
remove redundent in client
fb0fcc8
add doc on type config
cosmicshuai d429fd9
fix
cosmicshuai 67edb14
modify doc type format
5eb3d05
fix
8e2784b
change version of bf-lu
cosmicshuai 57f955a
fix diagnostic
5323b40
refactor getRangeAtPosition method
99f2141
fix tokens
068b090
remove black line
9508fa4
fix tokens
c57ce7d
add roles suggestions
4791d96
add regex entity seperated line definition
37b58cd
add suggestions for ml entity
61891a1
matching only ML entities
28481da
fix
a362a32
update documents
5734502
fix
ef16147
Merge branch 'master' into shuwan/AddLu_LSP
1324176
integrate lu-lsp to composer
83b31ae
Merge branch 'shuwan/AddingLG_LSP' into shuwan/AddLu_LSP
ac0eeab
upgrade botbuilder-expressions
zhixzhan 522e228
clean up
zhixzhan d9178d1
update sample
zhixzhan 32e45be
Merge branch 'master' into shuwan/AddLu_LSP
zhixzhan 4bb6108
add test
zhixzhan 67faf9f
add syntax highlight
0dbcb31
add token rule for {@ expr
1d1d42a
add a case in token
b33c89d
fix import statement token
c7a5ea4
fix composite entity auto complete
499fb49
fix entity suggestion and tokens
93e94c7
Merge branch 'master' into shuwan/AddLu_LSP
08e5115
add labeling experience of add unlabeled entity
9c3553e
Merge branch 'shuwan/AddLu_LSP' of https://github.com/microsoft/BotFr…
589a13a
fix typos
e1f402e
fix lint
09b2028
fix redundent edits
fa49d8b
Merge branch 'master' into shuwan/AddLu_LSP
363f926
Merge branch 'master' into shuwan/AddLu_LSP
54404a8
fix unnecessary space
481ec44
Merge branch 'master' into shuwan/AddLu_LSP
1296d71
Merge branch 'master' into shuwan/AddLu_LSP
3b2bc7d
fix naming and role suggestions
46a4cbc
fix labeling and error postion
fcf6d9b
fix insert text in wrong line, intent usesFeature
0320505
Merge branch 'master' into shuwan/AddLu_LSP
ab4d6ad
update bf-lu version
7691994
change find a valid luisJson and suggest composite
01041b2
Merge branch 'master' into shuwan/AddLu_LSP
8a3976d
add unit test for LU lsp basic funcionalities
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| // Licensed under the MIT License. | ||
|
|
||
| export * from './lg'; | ||
| export * from './lu'; | ||
This file contains hidden or 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,76 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import * as monacoEditor from '@bfcomposer/monaco-editor/esm/vs/editor/editor.api'; | ||
|
|
||
| export function registerLULanguage(monaco: typeof monacoEditor) { | ||
| monaco.languages.setMonarchTokensProvider('botframeworklu', { | ||
| tokenizer: { | ||
| root: [ | ||
| [/^\s*#/, { token: 'intent', next: '@intent' }], | ||
| [/^\s*@/, { token: 'entity-identifier', goBack: 1, next: '@entity_mode' }], | ||
| [/^\s*>\s*[\s\S]*$/, { token: 'comments' }], | ||
| ], | ||
|
|
||
| intent: [ | ||
| [/^\s*#/, { token: 'intent', next: '@intent' }], | ||
| [/^\s*-/, { token: 'utterrance-indentifier', next: '@utterrance' }], | ||
| [/^\s*>\s*[\s\S]*$/, { token: 'comments' }], | ||
| [/^\s*@/, { token: 'entity-identifier', goBack: 1, next: '@entity_mode' }], | ||
| [/.*$/, 'intent'], | ||
| ], | ||
| utterrance: [ | ||
| [/^\s*#/, { token: 'intent', next: '@intent' }], | ||
| [/^\s*>\s*[\s\S]*$/, { token: 'comments' }], | ||
| [/^\s*-/, { token: 'utterrance-indentifier', next: 'utterrance' }], | ||
| [/^\s*@/, { token: 'entity-identifier', goBack: 1, next: '@entity_mode' }], | ||
| [/({)(\s*[\w.\:\s]*\s*)(=)(\s*[\w.]*\s*)(})/, ['lb', 'pattern', 'equal', 'entity-name', 'rb']], | ||
| [/({\s*@)(\s*[\w.]*\s*)(})/, ['lb', 'entity-name', 'rb']], | ||
| [/\s*\[[\w\s.]+\]\(.{1,2}\/[\w.*]+(#[\w.?]+)?\)/, 'import-desc'], | ||
| [/./, 'utterance-other'], | ||
| ], | ||
| entity_mode: [ | ||
| [/^\s*#/, { token: 'intent', next: '@intent' }], | ||
| [/^\s*>\s*[\s\S]*$/, { token: 'comments' }], | ||
| [/^\s*-/, { token: 'utterrance-indentifier', next: 'utterrance' }], | ||
| [ | ||
| /(@\s*)(ml|prebuilt|regex|list|composite|patternany|phraselist)(\s*\w*)/, | ||
| ['intent-indentifier', 'entity-type', 'entity-name'], | ||
| ], | ||
| [/(@\s*)(\s*\w*)/, ['intent-indentifier', 'entity-name']], | ||
| [/\s*(hasRoles|useFeature)\s*/, 'keywords'], | ||
| [/.*$/, 'entity-other', '@pop'], | ||
| ], | ||
| }, | ||
| }); | ||
|
|
||
| monaco.languages.register({ | ||
| id: 'botframeworklu', | ||
|
cosmicshuai marked this conversation as resolved.
Outdated
|
||
| extensions: ['.lu'], | ||
| aliases: ['LU', 'language-understanding'], | ||
| mimetypes: ['application/lu'], | ||
| }); | ||
|
|
||
| monaco.languages.setLanguageConfiguration('botframeworklu', { | ||
| autoClosingPairs: [ | ||
| { open: '{', close: '}' }, | ||
| { open: '[', close: ']' }, | ||
| { open: '(', close: ')' }, | ||
| ], | ||
| }); | ||
|
|
||
| monaco.editor.defineTheme('lutheme', { | ||
|
cosmicshuai marked this conversation as resolved.
Outdated
|
||
| base: 'vs', | ||
| inherit: false, | ||
| colors: {}, | ||
| rules: [ | ||
| { token: 'intent', foreground: '0000FF' }, | ||
| { token: 'pattern', foreground: '00B7C3' }, | ||
| { token: 'entity-name', foreground: '038387' }, | ||
| { token: 'comments', foreground: '7A7A7A' }, | ||
| { token: 'import-desc', foreground: '00A32B' }, | ||
| { token: 'entity-type', foreground: 'DF2C2C' }, | ||
| { token: 'keywords', foreground: '0078D7' }, | ||
| ], | ||
| }); | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
3 changes: 3 additions & 0 deletions
3
Composer/packages/tools/language-servers/language-understanding/.gitignore
This file contains hidden or 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 @@ | ||
| /lib | ||
| /demo/lib | ||
| /demo/dist |
27 changes: 27 additions & 0 deletions
27
Composer/packages/tools/language-servers/language-understanding/README.md
This file contains hidden or 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,27 @@ | ||
| # Language-understanding language server demo | ||
|
|
||
|
|
||
|
|
||
| ## goto language-understanding directory, install packages, run | ||
| ``` | ||
| npm install | ||
| ``` | ||
|
|
||
| ## How to start the demo | ||
|
|
||
| #### 1. under language-understanding directory, run | ||
| ``` | ||
| yarn start | ||
| ``` | ||
|
|
||
| ### 2. go to code-editor directory | ||
|
|
||
| start luEditor demo, connect :5003/lu-language-server | ||
|
|
||
| ## Features | ||
|
|
||
| ### 1.Auto-suggestions for entity types and defined entities | ||
|
|
||
| ### 2.Syntax and semantic diagonostics | ||
|
|
||
| ### Auto-copletion for ml entities and list entities |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.