Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
erp5
Commits
2e3bdd7c
Commit
2e3bdd7c
authored
Nov 12, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monaco_editor: pass portal_type to checkPythonSourceCode
parent
e0202a85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
...ortal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
+14
-9
No files found.
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco-editor.gadget.js.js
View file @
2e3bdd7c
...
@@ -94,6 +94,7 @@
...
@@ -94,6 +94,7 @@
const
data
=
new
FormData
();
const
data
=
new
FormData
();
const
checker_parameters
=
{
const
checker_parameters
=
{
code
:
context
.
editor
.
getValue
(),
code
:
context
.
editor
.
getValue
(),
portal_type
:
context
.
state
.
portal_type
,
};
};
data
.
append
(
'
data
'
,
JSON
.
stringify
(
checker_parameters
));
data
.
append
(
'
data
'
,
JSON
.
stringify
(
checker_parameters
));
...
@@ -175,6 +176,7 @@
...
@@ -175,6 +176,7 @@
model_language
=
'
python
'
;
model_language
=
'
python
'
;
}
}
state_dict
.
model_language
=
model_language
;
state_dict
.
model_language
=
model_language
;
state_dict
.
portal_type
=
options
.
portal_type
;
state_dict
.
value
=
options
.
value
||
''
;
state_dict
.
value
=
options
.
value
||
''
;
state_dict
.
language_support_url
=
options
.
language_support_url
||
''
;
state_dict
.
language_support_url
=
options
.
language_support_url
||
''
;
return
this
.
changeState
(
state_dict
);
return
this
.
changeState
(
state_dict
);
...
@@ -335,7 +337,7 @@
...
@@ -335,7 +337,7 @@
);
);
monaco
.
languages
.
registerCompletionItemProvider
(
'
python
'
,
{
monaco
.
languages
.
registerCompletionItemProvider
(
'
python
'
,
{
provideCompletionItems
:
async
function
(
provideCompletionItems
:
async
function
(
model
,
model
,
position
,
position
,
context
,
context
,
...
@@ -348,7 +350,10 @@
...
@@ -348,7 +350,10 @@
const
data
=
new
FormData
();
const
data
=
new
FormData
();
const
complete_parameters
=
{
const
complete_parameters
=
{
code
:
model
.
getValue
(),
code
:
model
.
getValue
(),
position
:
{
line
:
position
.
lineNumber
,
column
:
position
.
column
}
position
:
{
line
:
position
.
lineNumber
,
column
:
position
.
column
,
},
};
};
data
.
append
(
'
data
'
,
JSON
.
stringify
(
complete_parameters
));
data
.
append
(
'
data
'
,
JSON
.
stringify
(
complete_parameters
));
...
@@ -358,29 +363,29 @@
...
@@ -358,29 +363,29 @@
{
{
method
:
'
POST
'
,
method
:
'
POST
'
,
body
:
data
,
body
:
data
,
signal
:
controller
.
signal
signal
:
controller
.
signal
,
}
}
)
)
.
then
(
response
=>
response
.
json
())
.
then
(
(
response
)
=>
response
.
json
())
.
then
(
.
then
(
data
=>
{
(
data
)
=>
{
return
{
return
{
suggestions
:
data
.
map
(
c
=>
{
suggestions
:
data
.
map
(
(
c
)
=>
{
c
.
kind
=
monaco
.
languages
.
CompletionItemKind
[
c
.
_kind
];
c
.
kind
=
monaco
.
languages
.
CompletionItemKind
[
c
.
_kind
];
// this makes monaco render documentation as markdown.
// this makes monaco render documentation as markdown.
c
.
documentation
=
{
value
:
c
.
documentation
};
c
.
documentation
=
{
value
:
c
.
documentation
};
return
c
;
return
c
;
})
})
,
};
};
},
},
e
=>
{
(
e
)
=>
{
if
(
!
(
e
instanceof
DOMException
)
/* AbortError */
)
{
if
(
!
(
e
instanceof
DOMException
)
/* AbortError */
)
{
throw
e
;
throw
e
;
}
}
/* ignore aborted requests */
/* ignore aborted requests */
}
}
);
);
}
}
,
});
});
this
.
runPyLint
();
this
.
runPyLint
();
...
...
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