How to use the pygls.lsp.types.Position function in pygls

To help you get started, we’ve selected a few pygls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_position():
    assert Position(1, 2) == Position(1, 2)
    assert Position(1, 2) != Position(2, 2)
    assert Position(1, 2) <= Position(2, 2)
    assert Position(2, 2) >= Position(2, 0)
    assert Position(1, 2) != 'something else'
    assert "1:2" == repr(Position(1, 2))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_range():
    assert Range(Position(1, 2), Position(3, 4)) \
        == Range(Position(1, 2), Position(3, 4))
    assert Range(Position(0, 2), Position(3, 4)) \
        != Range(Position(1, 2), Position(3, 4))
    assert Range(Position(0, 2), Position(3, 4)) != 'something else'
    assert "1:2-3:4" == repr(Range(Position(1, 2), Position(3, 4)))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_range():
    assert Range(Position(1, 2), Position(3, 4)) \
        == Range(Position(1, 2), Position(3, 4))
    assert Range(Position(0, 2), Position(3, 4)) \
        != Range(Position(1, 2), Position(3, 4))
    assert Range(Position(0, 2), Position(3, 4)) != 'something else'
    assert "1:2-3:4" == repr(Range(Position(1, 2), Position(3, 4)))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_position():
    assert Position(1, 2) == Position(1, 2)
    assert Position(1, 2) != Position(2, 2)
    assert Position(1, 2) <= Position(2, 2)
    assert Position(2, 2) >= Position(2, 0)
    assert Position(1, 2) != 'something else'
    assert "1:2" == repr(Position(1, 2))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_range():
    assert Range(Position(1, 2), Position(3, 4)) \
        == Range(Position(1, 2), Position(3, 4))
    assert Range(Position(0, 2), Position(3, 4)) \
        != Range(Position(1, 2), Position(3, 4))
    assert Range(Position(0, 2), Position(3, 4)) != 'something else'
    assert "1:2-3:4" == repr(Range(Position(1, 2), Position(3, 4)))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_position():
    assert Position(1, 2) == Position(1, 2)
    assert Position(1, 2) != Position(2, 2)
    assert Position(1, 2) <= Position(2, 2)
    assert Position(2, 2) >= Position(2, 0)
    assert Position(1, 2) != 'something else'
    assert "1:2" == repr(Position(1, 2))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_location():
    assert Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4))) \
        == Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4)))
    assert Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4))) \
        != Location(uri="file:///another.txt", range=Range(Position(1, 2), Position(3, 4)))
    assert Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4))) \
        != 'something else'
    assert "file:///document.txt:1:2-3:4" == repr(Location(
        uri="file:///document.txt",
        range=Range(Position(1, 2), Position(3, 4))))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_location():
    assert Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4))) \
        == Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4)))
    assert Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4))) \
        != Location(uri="file:///another.txt", range=Range(Position(1, 2), Position(3, 4)))
    assert Location(uri="file:///document.txt", range=Range(Position(1, 2), Position(3, 4))) \
        != 'something else'
    assert "file:///document.txt:1:2-3:4" == repr(Location(
        uri="file:///document.txt",
        range=Range(Position(1, 2), Position(3, 4))))
github openlawlibrary / pygls / tests / test_types.py View on Github external
def test_position():
    assert Position(1, 2) == Position(1, 2)
    assert Position(1, 2) != Position(2, 2)
    assert Position(1, 2) <= Position(2, 2)
    assert Position(2, 2) >= Position(2, 0)
    assert Position(1, 2) != 'something else'
    assert "1:2" == repr(Position(1, 2))