当前位置: 首页>>代码示例>>Golang>>正文


Golang CompleteAtArgs.SessionId方法代码示例

本文整理汇总了Golang中github.com/quarnster/completion/content.CompleteAtArgs.SessionId方法的典型用法代码示例。如果您正苦于以下问题:Golang CompleteAtArgs.SessionId方法的具体用法?Golang CompleteAtArgs.SessionId怎么用?Golang CompleteAtArgs.SessionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/quarnster/completion/content.CompleteAtArgs的用法示例。


在下文中一共展示了CompleteAtArgs.SessionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestNet

func TestNet(t *testing.T) {
	paths := DefaultPaths()
	if len(paths) == 0 {
		t.Skip("Neither mono nor Windows .NET Framework paths were possible to get")
	}

	var (
		n    Net
		args content.CompleteAtArgs
		cmp  content.CompletionResult
	)

	tests := []struct {
		InFile       string
		Line, Column uint
	}{
		// TODO: this test is not platform independent as it depends on whatever framework you happen
		//       to have installed
		{"./testdata/CompleteSharp.cs", 40, 27},
		{"./testdata/CompleteSharp.cs", 40, 41},
		{"./testdata/CompleteSharp.cs", 47, 47},
		//{"./testdata/CompleteSharp.cs", 28, 14},
		{"./testdata/CompleteSharp.cs", 211, 46},
		{"./testdata/CompleteSharp.cs", 761, 83},
		{"./testdata/CompleteSharp.cs", 761, 27},
		{"./testdata/CompleteSharp.cs", 857, 29},
		{"./testdata/CompleteSharp.cs", 737, 15},
		{"./testdata/CompleteSharp.cs", 95, 38},
		{"./testdata/CompleteSharp.cs", 95, 45},
		{"./testdata/CompleteSharp.cs", 776, 39},
		{"./testdata/NamespaceTest.cs", 4, 15},
		{"./testdata/NamespaceTest.cs", 6, 15},
	}
	args.SessionId = "a"
	args.Settings().Set("net_paths", []string{"./testdata/"})
	args.Settings().Set("net_assemblies", []string{"CompleteSharp.exe"})
	for _, test := range tests {
		args.Location.File.Name = test.InFile
		args.Location.Line = test.Line
		args.Location.Column = test.Column
		ex := fmt.Sprintf("%s-%d-%d.cmp", test.InFile, test.Line, test.Column)
		if err := n.CompleteAt(&args, &cmp); err != nil {
			t.Errorf("Unable to complete %v: %s", test, err)
		} else if exp, err := ioutil.ReadFile(ex); err != nil {
			t.Logf("Couldn't read the expected output file %s (%s); it'll be created", ex, err)
			if err := ioutil.WriteFile(ex, []byte(cmp.String()), 0644); err != nil {
				t.Error(err)
			}
		} else if d := util.Diff(string(exp), cmp.String()); len(d) != 0 {
			t.Error(d)
		}
	}
}
开发者ID:noname007,项目名称:completion,代码行数:53,代码来源:net_test.go


注:本文中的github.com/quarnster/completion/content.CompleteAtArgs.SessionId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。