Skip to content

fmt lsp, utilize DocumentUri, add methods#19

Merged
danieldaeschle merged 10 commits intomasterfrom
use-document-uri
Dec 16, 2020
Merged

fmt lsp, utilize DocumentUri, add methods#19
danieldaeschle merged 10 commits intomasterfrom
use-document-uri

Conversation

@nedpals
Copy link
Contributor

@nedpals nedpals commented Dec 15, 2020

closes #10

lsp/lsp.v Outdated
type DocumentUri = string

pub fn (du DocumentUri) str() string {
return du
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just asking. is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to testing. See the updated commit for an updated version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need a str() method. This works on my PC:

type DocUri = string

fn main() {
	uri := DocUri('test')
	println(uri.str() == 'test')
}


fn test_document_uri_from_path() {
input := '/foo/bar/test.v'
assert document_uri_from_path(input).str() == 'file:///foo/bar/test.v'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document_uri_from_path(input) == 'file:///foo/bar/test.v' doesn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it produces a c error for some reason. i will revert the change if you want and place it in a separate variable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if that works, yes. i want to prevent custom str() methods if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still causes a C gen error apparently 🙁 I've added a note about it

@nedpals nedpals changed the title utilize DocumentUri, add methods fmt lsp, utilize DocumentUri, add methods Dec 16, 2020
@danieldaeschle danieldaeschle merged commit 36a08bb into master Dec 16, 2020
@danieldaeschle danieldaeschle deleted the use-document-uri branch December 16, 2020 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify text document URI conversion methods

2 participants