Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
15993df1
Commit
15993df1
authored
Jun 07, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove need to pass monaco around through DI
parent
2729205b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
15 deletions
+12
-15
app/assets/javascripts/ide/lib/common/model.js
app/assets/javascripts/ide/lib/common/model.js
+2
-1
app/assets/javascripts/ide/lib/common/model_manager.js
app/assets/javascripts/ide/lib/common/model_manager.js
+2
-3
app/assets/javascripts/ide/lib/editor.js
app/assets/javascripts/ide/lib/editor.js
+1
-1
spec/javascripts/ide/lib/common/model_manager_spec.js
spec/javascripts/ide/lib/common/model_manager_spec.js
+1
-2
spec/javascripts/ide/lib/common/model_spec.js
spec/javascripts/ide/lib/common/model_spec.js
+2
-3
spec/javascripts/ide/lib/decorations/controller_spec.js
spec/javascripts/ide/lib/decorations/controller_spec.js
+1
-2
spec/javascripts/ide/lib/diff/controller_spec.js
spec/javascripts/ide/lib/diff/controller_spec.js
+3
-3
No files found.
app/assets/javascripts/ide/lib/common/model.js
View file @
15993df1
import
*
as
monaco
from
'
monaco-editor
'
;
import
Disposable
from
'
./disposable
'
;
import
Disposable
from
'
./disposable
'
;
import
eventHub
from
'
../../eventhub
'
;
import
eventHub
from
'
../../eventhub
'
;
export
default
class
Model
{
export
default
class
Model
{
constructor
(
monaco
,
file
,
head
=
null
)
{
constructor
(
file
,
head
=
null
)
{
this
.
monaco
=
monaco
;
this
.
monaco
=
monaco
;
this
.
disposable
=
new
Disposable
();
this
.
disposable
=
new
Disposable
();
this
.
file
=
file
;
this
.
file
=
file
;
...
...
app/assets/javascripts/ide/lib/common/model_manager.js
View file @
15993df1
...
@@ -3,8 +3,7 @@ import Disposable from './disposable';
...
@@ -3,8 +3,7 @@ import Disposable from './disposable';
import
Model
from
'
./model
'
;
import
Model
from
'
./model
'
;
export
default
class
ModelManager
{
export
default
class
ModelManager
{
constructor
(
monaco
)
{
constructor
()
{
this
.
monaco
=
monaco
;
this
.
disposable
=
new
Disposable
();
this
.
disposable
=
new
Disposable
();
this
.
models
=
new
Map
();
this
.
models
=
new
Map
();
}
}
...
@@ -22,7 +21,7 @@ export default class ModelManager {
...
@@ -22,7 +21,7 @@ export default class ModelManager {
return
this
.
getModel
(
file
.
key
);
return
this
.
getModel
(
file
.
key
);
}
}
const
model
=
new
Model
(
this
.
monaco
,
file
,
head
);
const
model
=
new
Model
(
file
,
head
);
this
.
models
.
set
(
model
.
path
,
model
);
this
.
models
.
set
(
model
.
path
,
model
);
this
.
disposable
.
add
(
model
);
this
.
disposable
.
add
(
model
);
...
...
app/assets/javascripts/ide/lib/editor.js
View file @
15993df1
...
@@ -31,7 +31,7 @@ export default class Editor {
...
@@ -31,7 +31,7 @@ export default class Editor {
this
.
instance
=
null
;
this
.
instance
=
null
;
this
.
dirtyDiffController
=
null
;
this
.
dirtyDiffController
=
null
;
this
.
disposable
=
new
Disposable
();
this
.
disposable
=
new
Disposable
();
this
.
modelManager
=
new
ModelManager
(
this
.
monaco
);
this
.
modelManager
=
new
ModelManager
();
this
.
decorationsController
=
new
DecorationsController
(
this
);
this
.
decorationsController
=
new
DecorationsController
(
this
);
this
.
setupMonacoTheme
();
this
.
setupMonacoTheme
();
...
...
spec/javascripts/ide/lib/common/model_manager_spec.js
View file @
15993df1
import
*
as
monaco
from
'
monaco-editor
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
ModelManager
from
'
~/ide/lib/common/model_manager
'
;
import
ModelManager
from
'
~/ide/lib/common/model_manager
'
;
import
{
file
}
from
'
../../helpers
'
;
import
{
file
}
from
'
../../helpers
'
;
...
@@ -7,7 +6,7 @@ describe('Multi-file editor library model manager', () => {
...
@@ -7,7 +6,7 @@ describe('Multi-file editor library model manager', () => {
let
instance
;
let
instance
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
instance
=
new
ModelManager
(
monaco
);
instance
=
new
ModelManager
();
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
...
spec/javascripts/ide/lib/common/model_spec.js
View file @
15993df1
import
*
as
monaco
from
'
monaco-editor
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
Model
from
'
~/ide/lib/common/model
'
;
import
Model
from
'
~/ide/lib/common/model
'
;
import
{
file
}
from
'
../../helpers
'
;
import
{
file
}
from
'
../../helpers
'
;
...
@@ -12,7 +11,7 @@ describe('Multi-file editor library model', () => {
...
@@ -12,7 +11,7 @@ describe('Multi-file editor library model', () => {
const
f
=
file
(
'
path
'
);
const
f
=
file
(
'
path
'
);
f
.
mrChange
=
{
diff
:
'
ABC
'
};
f
.
mrChange
=
{
diff
:
'
ABC
'
};
f
.
baseRaw
=
'
test
'
;
f
.
baseRaw
=
'
test
'
;
model
=
new
Model
(
monaco
,
f
);
model
=
new
Model
(
f
);
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -33,7 +32,7 @@ describe('Multi-file editor library model', () => {
...
@@ -33,7 +32,7 @@ describe('Multi-file editor library model', () => {
const
f
=
file
(
'
path
'
);
const
f
=
file
(
'
path
'
);
model
.
dispose
();
model
.
dispose
();
model
=
new
Model
(
monaco
,
f
,
{
model
=
new
Model
(
f
,
{
...
f
,
...
f
,
content
:
'
123 testing
'
,
content
:
'
123 testing
'
,
});
});
...
...
spec/javascripts/ide/lib/decorations/controller_spec.js
View file @
15993df1
import
*
as
monaco
from
'
monaco-editor
'
;
import
Editor
from
'
~/ide/lib/editor
'
;
import
Editor
from
'
~/ide/lib/editor
'
;
import
DecorationsController
from
'
~/ide/lib/decorations/controller
'
;
import
DecorationsController
from
'
~/ide/lib/decorations/controller
'
;
import
Model
from
'
~/ide/lib/common/model
'
;
import
Model
from
'
~/ide/lib/common/model
'
;
...
@@ -14,7 +13,7 @@ describe('Multi-file editor library decorations controller', () => {
...
@@ -14,7 +13,7 @@ describe('Multi-file editor library decorations controller', () => {
editorInstance
.
createInstance
(
document
.
createElement
(
'
div
'
));
editorInstance
.
createInstance
(
document
.
createElement
(
'
div
'
));
controller
=
new
DecorationsController
(
editorInstance
);
controller
=
new
DecorationsController
(
editorInstance
);
model
=
new
Model
(
monaco
,
file
(
'
path
'
));
model
=
new
Model
(
file
(
'
path
'
));
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
...
spec/javascripts/ide/lib/diff/controller_spec.js
View file @
15993df1
import
*
as
monaco
from
'
monaco-editor
'
;
import
{
Range
}
from
'
monaco-editor
'
;
import
Editor
from
'
~/ide/lib/editor
'
;
import
Editor
from
'
~/ide/lib/editor
'
;
import
ModelManager
from
'
~/ide/lib/common/model_manager
'
;
import
ModelManager
from
'
~/ide/lib/common/model_manager
'
;
import
DecorationsController
from
'
~/ide/lib/decorations/controller
'
;
import
DecorationsController
from
'
~/ide/lib/decorations/controller
'
;
...
@@ -17,7 +17,7 @@ describe('Multi-file editor library dirty diff controller', () => {
...
@@ -17,7 +17,7 @@ describe('Multi-file editor library dirty diff controller', () => {
editorInstance
=
Editor
.
create
();
editorInstance
=
Editor
.
create
();
editorInstance
.
createInstance
(
document
.
createElement
(
'
div
'
));
editorInstance
.
createInstance
(
document
.
createElement
(
'
div
'
));
modelManager
=
new
ModelManager
(
monaco
);
modelManager
=
new
ModelManager
();
decorationsController
=
new
DecorationsController
(
editorInstance
);
decorationsController
=
new
DecorationsController
(
editorInstance
);
model
=
modelManager
.
addModel
(
file
(
'
path
'
));
model
=
modelManager
.
addModel
(
file
(
'
path
'
));
...
@@ -165,7 +165,7 @@ describe('Multi-file editor library dirty diff controller', () => {
...
@@ -165,7 +165,7 @@ describe('Multi-file editor library dirty diff controller', () => {
[],
[],
[
[
{
{
range
:
new
monaco
.
Range
(
1
,
1
,
1
,
1
),
range
:
new
Range
(
1
,
1
,
1
,
1
),
options
:
{
options
:
{
isWholeLine
:
true
,
isWholeLine
:
true
,
linesDecorationsClassName
:
'
dirty-diff dirty-diff-modified
'
,
linesDecorationsClassName
:
'
dirty-diff dirty-diff-modified
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment