-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add option to show language scopes - Add menu to sidebar and enable support for shortcuts
- Loading branch information
Showing
17 changed files
with
81 additions
and
16 deletions.
There are no files selected for viewing
10 changes: 8 additions & 2 deletions
10
...ols-Editor-Core.package/PolyglotNotebook.extension/instance/addModelItemsToWindowMenu..st
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
*TruffleSqueak-Tools-Editor-Core | ||
addModelItemsToWindowMenu: aMenu | ||
|
||
aMenu addLine. | ||
aMenu | ||
addUpdating: #toggleShowLanguageScopesLabel | ||
target: self | ||
action: #toggleShowLanguageScopes. | ||
|
||
Smalltalk at: #PolyglotEditor ifPresent: [ :unused | | ||
aMenu addLine. | ||
aMenu | ||
add: 'open in Polyglot Editor' | ||
target: self | ||
selector: #openInPolyglotEditor. | ||
aMenu addLine ]. | ||
selector: #openInPolyglotEditor ]. | ||
|
||
super addModelItemsToWindowMenu: aMenu |
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
...leSqueak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/currentSelection..st
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,8 @@ | ||
model | ||
currentSelection: anObject | ||
|
||
self currentSelection == anObject ifTrue: [^ self]. | ||
|
||
currentSelection := anObject. | ||
|
||
self changed: #currentSelection. |
2 changes: 1 addition & 1 deletion
2
...fleSqueak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/currentSelection.st
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
model | ||
currentSelection | ||
|
||
^ 1 | ||
^ currentSelection |
10 changes: 10 additions & 0 deletions
10
...ak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/explorerKey.from.event..st
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,10 @@ | ||
actions | ||
explorerKey: aChar from: view event: event | ||
|
||
event anyModifierKeyPressed ifFalse: [^ false]. | ||
|
||
self currentSelection ifNotNil: [ :obj | | ||
aChar == $i ifTrue: [obj value inspect. ^ true]. | ||
aChar == $I ifTrue: [obj value explore. ^ true] ]. | ||
|
||
^ false |
9 changes: 9 additions & 0 deletions
9
...TruffleSqueak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/genericMenu..st
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,9 @@ | ||
actions | ||
genericMenu: aMenu | ||
^ aMenu | ||
add: 'inspect (i)' | ||
target: self currentSelection value | ||
selector: #inspect; | ||
add: 'explore (I)' | ||
target: self currentSelection value | ||
selector: #explore |
6 changes: 5 additions & 1 deletion
6
src/TruffleSqueak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/getList.st
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
model | ||
getList | ||
^ {'bindings' -> cellContainer bindings } | ||
^ {'bindings' -> cellContainer bindings }, | ||
(self showLanguageScopes | ||
ifTrue: [ Polyglot availableLanguages collect: [ :ea | | ||
ea getName asString -> (Polyglot primitiveGetScope: ea getId asSymbol) ] ] | ||
ifFalse: [ #() ]) |
5 changes: 5 additions & 0 deletions
5
src/TruffleSqueak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/getMenu..st
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,5 @@ | ||
actions | ||
getMenu: shiftKeyState | ||
^ (shiftKeyState not or: [Preferences noviceMode]) | ||
ifTrue: [TextEditor yellowButtonMenu] | ||
ifFalse: [TextEditor shiftedYellowButtonMenu] |
3 changes: 3 additions & 0 deletions
3
...eSqueak-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/showLanguageScopes.st
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 @@ | ||
accessing | ||
showLanguageScopes | ||
^ showLanguageScopes ifNil: [ showLanguageScopes := false ] |
4 changes: 4 additions & 0 deletions
4
...k-Tools-Notebook-Core.package/PolyglotNotebook.class/instance/toggleShowLanguageScopes.st
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,4 @@ | ||
actions | ||
toggleShowLanguageScopes | ||
showLanguageScopes := self showLanguageScopes not. | ||
self changed: #getList |
6 changes: 6 additions & 0 deletions
6
...ls-Notebook-Core.package/PolyglotNotebook.class/instance/toggleShowLanguageScopesLabel.st
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,6 @@ | ||
actions | ||
toggleShowLanguageScopesLabel | ||
|
||
^self showLanguageScopes | ||
ifTrue: [ '<on> show language scopes' ] | ||
ifFalse: [ '<off> show language scopes' ] |
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
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