Issue 1:
Expected Behaviour

deno lsp should support and format files with emojis inside.

Actual Behaviour

Starting Deno language server...
version: 1.6.3 (release, x86_64-unknown-linux-gnu)
Connected to "vscode" 1.52.1
language server initialized
Server ready.
thread 'main' panicked at 'assertion failed: self.is_char_boundary(n)', /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/string.rs:1555:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Error - 10:46:37 PM] Connection to server got closed. Server will not be restarted.
[Error - 10:46:37 PM] Request textDocument/formatting failed.
Error: Connection got disposed.
at Object.dispose (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at Object.dispose (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-languageclient/lib/client.js:74:35)
at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-languageclient/lib/client.js:2309:42)
at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-languageclient/lib/main.js:155:15)
at closeHandler (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-languageclient/lib/client.js:2296:18)
at CallbackList.invoke (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at StreamMessageReader.fireClose (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
at Socket.<anonymous> (/root/.vscode-server/extensions/denoland.vscode-deno-canary-0.0.6/client/node_modules/vscode-jsonrpc/lib/messageReader.js:151:46)
at Socket.emit (events.js:228:7)
at Pipe.<anonymous> (net.js:664:12)

Steps to Reproduce

Create a file with globalThis.console.log(💩)

Try to format it with vscode-deno-canary

Using

deno 1.6.3 (release, x86_64-unknown-linux-gnu)

v8 8.8.294

typescript 4.1.3

vscode 1.52.1

denoland.vscode-deno-canary

Issue 2:
Editing, or creating a document with the following text causes all sorts of issues and lsp server crashes:

const foo = `编写软件很难`;

console.log(foo);

For example, changing .log to .warn will result in bad diagnostics like:

Unterminated template literal.

This is because characters are not being counted the same between what is being sent by the lsp and how the lsp internally calculates them, causing the internal file to be updated in the wrong location.