File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export class PythonCompletionItemProvider implements vscode.CompletionItemProvid
2222 let completionItem = new vscode . CompletionItem ( item . text ) ;
2323 completionItem . kind = item . type ;
2424 completionItem . documentation = sigAndDocs [ 1 ] . length === 0 ? item . description : sigAndDocs [ 1 ] ;
25- completionItem . detail = sigAndDocs [ 0 ] . split ( EOL ) . join ( '' ) ;
25+ completionItem . detail = sigAndDocs [ 0 ] . split ( / \r ? \n / ) . join ( '' ) ;
2626 if ( pythonSettings . autoComplete . addBrackets === true &&
2727 ( item . kind === vscode . SymbolKind . Function || item . kind === vscode . SymbolKind . Method ) ) {
2828 completionItem . insertText = item . text + '({{}})' ;
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ export function extractSignatureAndDocumentation(definition: proxy.IAutoComplete
1616 /// ```
1717 const txt = definition . description || definition . text ;
1818 const rawDocString = typeof definition . raw_docstring === 'string' ? definition . raw_docstring . trim ( ) : '' ;
19- const firstLineOfRawDocString = rawDocString . length > 0 ? rawDocString . split ( EOL ) [ 0 ] : '' ;
20- let lines = txt . split ( EOL ) ;
19+ const firstLineOfRawDocString = rawDocString . length > 0 ? rawDocString . split ( / \r ? \n / ) [ 0 ] : '' ;
20+ let lines = txt . split ( / \r ? \n / ) ;
2121 const startIndexOfDocString = firstLineOfRawDocString === '' ? - 1 : lines . findIndex ( line => line . indexOf ( firstLineOfRawDocString ) === 0 ) ;
2222
2323 let signatureLines = startIndexOfDocString === - 1 ? [ lines . shift ( ) ] : lines . splice ( 0 , startIndexOfDocString ) ;
@@ -49,7 +49,7 @@ export function extractSignatureAndDocumentation(definition: proxy.IAutoComplete
4949}
5050
5151export function highlightCode ( documentation : string ) : string {
52- let lines = documentation . split ( EOL ) ;
52+ let lines = documentation . split ( / \r ? \n / ) ;
5353 lines = lines . map ( line => {
5454 if ( line . trim ( ) . startsWith ( '>>> ' ) ) {
5555 return '```python\n' + line . substring ( 4 ) . trim ( ) + '\n```' ;
You can’t perform that action at this time.
0 commit comments