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
0
Merge Requests
0
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
Jérome Perrin
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
eventHub
from
'
../../eventhub
'
;
export
default
class
Model
{
constructor
(
monaco
,
file
,
head
=
null
)
{
constructor
(
file
,
head
=
null
)
{
this
.
monaco
=
monaco
;
this
.
disposable
=
new
Disposable
();
this
.
file
=
file
;
...
...
app/assets/javascripts/ide/lib/common/model_manager.js
View file @
15993df1
...
...
@@ -3,8 +3,7 @@ import Disposable from './disposable';
import
Model
from
'
./model
'
;
export
default
class
ModelManager
{
constructor
(
monaco
)
{
this
.
monaco
=
monaco
;
constructor
()
{
this
.
disposable
=
new
Disposable
();
this
.
models
=
new
Map
();
}
...
...
@@ -22,7 +21,7 @@ export default class ModelManager {
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
.
disposable
.
add
(
model
);
...
...
app/assets/javascripts/ide/lib/editor.js
View file @
15993df1
...
...
@@ -31,7 +31,7 @@ export default class Editor {
this
.
instance
=
null
;
this
.
dirtyDiffController
=
null
;
this
.
disposable
=
new
Disposable
();
this
.
modelManager
=
new
ModelManager
(
this
.
monaco
);
this
.
modelManager
=
new
ModelManager
();
this
.
decorationsController
=
new
DecorationsController
(
this
);
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
ModelManager
from
'
~/ide/lib/common/model_manager
'
;
import
{
file
}
from
'
../../helpers
'
;
...
...
@@ -7,7 +6,7 @@ describe('Multi-file editor library model manager', () => {
let
instance
;
beforeEach
(()
=>
{
instance
=
new
ModelManager
(
monaco
);
instance
=
new
ModelManager
();
});
afterEach
(()
=>
{
...
...
spec/javascripts/ide/lib/common/model_spec.js
View file @
15993df1
import
*
as
monaco
from
'
monaco-editor
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
Model
from
'
~/ide/lib/common/model
'
;
import
{
file
}
from
'
../../helpers
'
;
...
...
@@ -12,7 +11,7 @@ describe('Multi-file editor library model', () => {
const
f
=
file
(
'
path
'
);
f
.
mrChange
=
{
diff
:
'
ABC
'
};
f
.
baseRaw
=
'
test
'
;
model
=
new
Model
(
monaco
,
f
);
model
=
new
Model
(
f
);
});
afterEach
(()
=>
{
...
...
@@ -33,7 +32,7 @@ describe('Multi-file editor library model', () => {
const
f
=
file
(
'
path
'
);
model
.
dispose
();
model
=
new
Model
(
monaco
,
f
,
{
model
=
new
Model
(
f
,
{
...
f
,
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
DecorationsController
from
'
~/ide/lib/decorations/controller
'
;
import
Model
from
'
~/ide/lib/common/model
'
;
...
...
@@ -14,7 +13,7 @@ describe('Multi-file editor library decorations controller', () => {
editorInstance
.
createInstance
(
document
.
createElement
(
'
div
'
));
controller
=
new
DecorationsController
(
editorInstance
);
model
=
new
Model
(
monaco
,
file
(
'
path
'
));
model
=
new
Model
(
file
(
'
path
'
));
});
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
ModelManager
from
'
~/ide/lib/common/model_manager
'
;
import
DecorationsController
from
'
~/ide/lib/decorations/controller
'
;
...
...
@@ -17,7 +17,7 @@ describe('Multi-file editor library dirty diff controller', () => {
editorInstance
=
Editor
.
create
();
editorInstance
.
createInstance
(
document
.
createElement
(
'
div
'
));
modelManager
=
new
ModelManager
(
monaco
);
modelManager
=
new
ModelManager
();
decorationsController
=
new
DecorationsController
(
editorInstance
);
model
=
modelManager
.
addModel
(
file
(
'
path
'
));
...
...
@@ -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
:
{
isWholeLine
:
true
,
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